Needs review
Project:
CKEditor 4 - WYSIWYG HTML editor
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Mar 2011 at 11:02 UTC
Updated:
20 Oct 2021 at 09:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
megachrizI have made a port of the patch posted in #1050118-4: Added better support for Line break converter. CKEditor is now able to load properly content where new line characters were used with one difference: the convert happens in Drupal.ckeditorOn() instead of Drupal.ckeditorToggle(), because then the convert also happens when the editor is enabled by default.
I see the code in the Drupal 6 version has changed along the way where an
enterModehas been added. As I'm not yet familiar with the code I'm leaving it to someone else to add support forenterMode.Comment #2
mkesicki commented@ MegaChriz,
thank you for patch. We try check this as soon as possible.
Comment #3
SebCorbin commentedPatch worked well here
Comment #4
milesw commentedUpdated patch to apply to latest module version.
Comment #5
milesw commentedHmm, looks like there's an issue with this behavior remaining bound even after CKeditor has been disabled. When I select the "Plain text" format CKeditor disappears, but line breaks still end up being converted to paragraph tags.
Comment #6
ronino commentedPatch works for me, nice!
Comment #7
siramsay commentedpatch#4 confirmed to work by adding
<p>and<br />tags for linebreaks on opening node edit form. ckeditor 7.x - 1.16 and 7.x-1.16+9-devas per #5 converting to plain text doesn't remove tags
Comment #8
spaghettibolognese commentedI think this patch should fix the issues stated in #5 by @milesw. Please test!
Comment #10
spaghettibolognese commentedComment #15
donquixote commentedI am confused, what exactly is the intended behavior with this patch? The issue summary is not very detailed.
I found a lot of issues talking about line breaks.
https://www.drupal.org/project/issues/ckeditor?text=line+breaks&status=All
But I am still confused. I did not find the answers I was looking for.
The main conflict is this:
<br>and<p>)" filter is designed for source text without explicit<br>or<p>(paragraph) tags.When is this relevant?
I imagine the ideal behavior would be if CKEditor would produce source text WITHOUT these html tags.
For this, a two-way solution is needed:
Yes, this means there are two versions of the text at each time, and a realtime conversion needs to happen in both directions.
From the issue summary, I do not understand if this is the intended behavior we are trying to implement with this issue.
Comment #16
donquixote commentedBtw once we have this, we could also have other two-way conversions, e.g. for markdown-style bullet lists.
Comment #17
donquixote commentedOk I tested the patch from #8.
The behavior of the patch, as I experience it, is not a two-way conversion as in #15, but only a one-way conversion.
When editing content where the source has plain linebreaks instead of html tags, after saving, the source text in the database gets the html tags added.
Also, the tags stay there when switching to "Plain text" text format.
Still, this is better than the original behavior, where the tagless line breaks were just gone.
Comment #18
ronino commentedRerolled patch #8 against latest stable.