Saturday, 31 August 2013

CKEditor 4 and nonstandard HTML element

CKEditor 4 and nonstandard HTML element

Here is a nonstandard HTML element that I defined (AngularJS makes this
easy):
<exercise id="Sample Exercise" language="Scala" lectureId="5437"> This is
the text of the lecture </exercise>
If I use this element in an HTML document, each time I switch from
CKEditor's rendered mode to source mode a new empty paragraph is added
between each of the block elements in the document:
<p>&nbsp;</p>
The 2nd time I switch, I get two insertions:
<p>&nbsp;</p>
<p>&nbsp;</p>
The 3rd time I switch, I get three insertions between each block-level
element, etc:
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
Can anyone suggest a workaround?

No comments:

Post a Comment