Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Converting linebreaks when CKEditor in swtched off and toggle mode is enabled. It's related with issue #1050118: Added better support for Line break converter. CKEditor is now able to load properly content where new line characters were used where patch should be ported to D7.
Comment | File | Size | Author |
---|---|---|---|
#18 | d7_linebreaks-1084924-18.patch | 2.73 KB | Ronino |
| |||
#8 | d7_linebreaks-1084924-8.patch | 2.8 KB | SpaghettiBolognese |
| |||
#4 | ckeditor-line-break-converter-1084924-4.patch | 2.31 KB | milesw |
#1 | ckeditor-line-break-converter-1084924-1.patch | 2.25 KB | MegaChriz |
Comments
Comment #1
MegaChriz CreditAttribution: MegaChriz commentedI 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
enterMode
has 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 CreditAttribution: mkesicki commented@ MegaChriz,
thank you for patch. We try check this as soon as possible.
Comment #3
SebCorbin CreditAttribution: SebCorbin commentedPatch worked well here
Comment #4
milesw CreditAttribution: milesw commentedUpdated patch to apply to latest module version.
Comment #5
milesw CreditAttribution: 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 CreditAttribution: Ronino commentedPatch works for me, nice!
Comment #7
siramsay CreditAttribution: 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 CreditAttribution: SpaghettiBolognese at Emble commentedI think this patch should fix the issues stated in #5 by @milesw. Please test!
Comment #10
SpaghettiBolognese CreditAttribution: SpaghettiBolognese at Emble commentedComment #15
donquixote CreditAttribution: donquixote as a volunteer 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 CreditAttribution: donquixote as a volunteer commentedBtw once we have this, we could also have other two-way conversions, e.g. for markdown-style bullet lists.
Comment #17
donquixote CreditAttribution: donquixote as a volunteer 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 CreditAttribution: Ronino commentedRerolled patch #8 against latest stable.