Hi all,

When I insert a teaser break, CKEditor also inserts an unwanted paragraph break...

http://i.imgur.com/myUuY.jpg

=

http://i.imgur.com/IkJK2.jpg

example =

http://redsand.org/lorem-2

Can anyone please tell me how to fix this?

Thank you

Comments

juc1’s picture

PS my ckeditor is up to date (3.6.1).

mkesicki’s picture

Status: Active » Closed (works as designed)

I think this is good behaviour , because in this way you have correctly opened and closed tags in teaser mode and in full view.
For me this works as designed, but maybe others have different opinion.

mkesicki’s picture

Status: Closed (works as designed) » Postponed
juc1’s picture

@ michal_cksource - do you mean that a full view should look like this - paragraph break in the middle of a sentence??

http://redsand.org/lorem-2

juc1’s picture

StatusFileSize
new33.13 KB

screenshot

mkesicki’s picture

@Juc1 this link http://redsand.org/lorem-2 doesn't work.
I think we have some misunderstood about teaser break and how this works.
Teaser break is for add 'Read more ' link in teaser view (short version of article in some view).
I think that the best and easiest solution for you problem is to use teaser break in place between two paragraphs. This also is is logical solution, because placing it in middle of sentence (as in you example) has no sense for me. Please also check "Show summary in full view" option when you add article.
In Garland theme there is no pause between paragraph in full view of post. Try use this on other theme and check if the problem occurs on it.

juc1’s picture

@ michal_cksource - sorry the link doesn't work any more but the screenshot # 5 shows the problem - this screenshot is the full view after clicking on the 'read more' link in the teaser view (zen theme). I thought I could put 'read more link' anywhere I want (I think you can do this in tinymce). Anyway I will try with the Garland theme as you suggest.

Thanks

mkesicki’s picture

I am not 100% sure , but I think that read more link (teaser break) shows only in teaser mode and in view when you set it to show.

smscotten’s picture

Agreed that we ought to be able to put the teaser break in the middle of a sentence or even the middle of the word if it's what we want. Just because you like to end your teasers at the end of paragraphs doesn't mean the rest of us should have to. It's a teaser. Sometimes you want to leave people hanging so they want to read the rest of the [read more]

smscotten’s picture

Agreed that we ought to be able to put the teaser break in the middle of a sentence or even the middle of the word if it's what we want. Just because you like to end your teasers at the end of paragraphs doesn't mean the rest of us should have to. It's a teaser. Sometimes you want to leave people hanging so they want to read the rest of the

paragraph.

Is this really the desired behavior?

kendouglass’s picture

Sometimes you want to leave people hanging so they want to read the rest of the [read more]

Exactly!

rkdesantos’s picture

Agreed. The break should be able to be in the middle of a sentence to get users to view the entire post.

tangent’s picture

Version: 6.x-1.5 » 6.x-1.9
Category: support » bug
Status: Postponed » Active

In my opinion there are actual problems with the current implementation even if it is desirable to place a teaser break within a paragraph.

It is currently impossible add a teaser break or a page break in between block elements without CKEditor wrapping paragraph tags around the break element. This results in teasers always missing a closing paragraph tag and bodies potentially starting with a closing paragraph tag if the "Show summary in full view" option is disabled. This is the problem named in the issue title.

The core issue is about ensuring that CKEditor produces markup which will be well-formed in all view modes (teaser, full, body without summary, paged). Currently it does not. Input filters can help work around this by ensuring that tags are closed but this will still result in empty paragraph tags where the break element is positioned.

tangent’s picture

Version: 6.x-1.9 » 6.x-1.5
Category: bug » support
Status: Active » Postponed

Oops, it seems I was experiencing a behavior of HTMLPurifier and not by CKEditor. How embarrassing. Changing ticket settings back to their previous values.

I disabled the AutoFormat.AutoParagraph setting in HTMLPurifier to resolve the issue, for anyone else who experiences this.

jamix’s picture

Version: 6.x-1.5 » 7.x-1.x-dev
Category: support » bug
Status: Postponed » Needs review
StatusFileSize
new2 KB

I'm marking it as a bug report because with CKEditor disabled, you can insert teaser break in the middle of a paragraph and it won't break the paragraph in two. In response to #2:

I think this is good behaviour , because in this way you have correctly opened and closed tags in teaser mode and in full view.

Drupal normally takes care of that on the core level by running the output through _filter_htmlcorrector() in the text_summary() function.

I'm attaching a patch for Drupal 7.x-1.x that makes teaser break an inline element in CKEditor and doesn't cause paragraph splitting.

darvanen’s picture

Issue summary: View changes

Applied #15 to 7.x-1.15, works well, still goes to the end of tables and lists but doesn't break paras. Thanks for the patch!

darvanen’s picture

Ok so I've found that when the teaser break is inserted in the middle of a paragraph, it might be between <em> or <strong> tags or perhaps <span> if you allow them.

This means that when the teaser is shown it leaves an open tag that affects everything that comes after it - in my case that's the nav bar and sidebards (using Zen theme).

Is there any way we can re-write the code that previously broke the <p> block in two parts to get it work with in-line tags?:

range.splitBlock( 'p' );

darvanen’s picture

Assigned: Unassigned » darvanen
StatusFileSize
new2.74 KB

Re-rolled patch for current release with some code to split up inline html tags thanks to some generous help from Bergi at Stack Exchange which I then translated for CKEditor's API.

darvanen’s picture

Assigned: darvanen » Unassigned

Happy to update the patch as needed; unassigning since I'm not currently working on it.