This is a consequence of this issue, since it is caused by the returns added by the splitter's Join functionality, but the cause and consequences are different, so this is a separate report.

The principal is that users make HTML mistakes, and when they do, they should be able to revert and undo the mistake without having to make additional fixes to their HTML.

First example
1. With Filtered HTML on

2. Enter this:

<p><a href="http://drupal.org/node/159981">Test</a>.</p>

'
3. Place cursor immediately after "<" in final </p> tag and press Split.

4. Result

[Top box] <p><a href="http://drupal.org/node/159981">Test</a>.</

[Bottom box] p>

5. User realizes mistake, presses Join to undo, expecting to Undo the split by rejoining what was split. Instead:

<p><a href="http://drupal.org/node/159981">Test</a>.</

p>

6. Markup is now broken. p> displays as text.

Second example
1. With Full HTML on

2. Enter this:

<p><a href="http://drupal.org/node/159981">Test</a>.</p>

3. Place cursor immediately after first quote following @href and press Split.

4. The result:

[Top box] <p><a href="

[Bottom box] http://drupal.org/node/159981">Link</a>.</p>

5. User realizes mistake, presses Join to undo, expecting to Undo the split by rejoining what was split, and then immediately Saves.

6. HTML displays as link.

7. User clicks link, expecting it to work, but link is broken because carriage returns inserted by Splitter are turned into P tags inside the URL.

http://localhost.local/drupal/node/%3C/p%3E%3Cp%3Ehttp://drupal.org/node/159981

And so on.

6.0-beta4, OS X, FF 2.0.0.11, PHP 5.2.1

CommentFileSizeAuthor
#1 teaser_invalid_markup.patch661 bytestheborg

Comments

theborg’s picture

Assigned: Unassigned » theborg
Status: Active » Needs review
StatusFileSize
new661 bytes

This patch deletes the carriage return inserted when splitting the node, so it doesn't break html if joined again.

catch’s picture

This is a duplicate of #159981 - however the patch here is more recent, and less invasive, so leaving both open for now.

catch’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm this patch works as advertised - when rejoining the teaser, text is put back exactly how it was before split. I also agree this should be default behaviour.

Since the text is still displayed with the paragraph break when rendered, I'm tentatively going to mark this RTBC, since I think it fixes the split and rejoin issue without breaking the intentional visual separation of teaser and body that Steven mentioned on the other issue.

shunting’s picture

Thank you!

UPDATE Thank you!!

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs review

Well, well those newlines are there, so if you split a praraph in the middle, then when you join, the paragraph slit will remain but the teaser split will not. So it does expect you to break in the middle of some text, not in markup.

So if we remove this addition of newlines, two completely different paragraphs of text will merge when you merge the teaser and the body, right? Not something you would expect. Seems like we need some more thought here.

shunting’s picture

> it does expect you to break in the middle of some text

Yes, my use case is user error.

Nevertheless, it seems reasonable to me, from a usability standpoint, that a user should be able to back out of an error, without introducing the need for manual intervention (removing the extra linefeeds) that may itself be the source of further errors.

robin monks’s picture

Status: Needs review » Closed (duplicate)

I'm going to mark this as a duplicate of #159981, since that is more recent.

Robin