Opened 10 years ago

Closed 7 years ago

#13000 closed Bug (duplicate)

Custom HTML5 tag grows <p>&nbsp;</p> before and after

Reported by: Mike Slinn Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

We use a custom HTML5 tag: cad-enza. CKEditor 4.4.2 adds several blank paragraphs (<p>&nbsp;</p>) before and after each top-level custom HTML5 tag. Additional new empty paragraphs are added each time the user switches between source mode and rendered mode.

We found that if cad-enza tags are wrapped within another tag, such as <div><cad-enza whatever="blah"></cad-enza></div> or <span><cad-enza whatever="blah"></cad-enza></span> the extra empty paragraphs are not added.

Is there a way to suppress the generation of the blank paragraphs without having to wrap cad-enza tags in other tags?

Change History (2)

comment:1 Changed 10 years ago by Mike Slinn

I cross-posted an updated problem description to the forum in the hope that I might get a quicker response.

comment:2 Changed 7 years ago by Jakub Ś

Resolution: duplicate
Status: newclosed

CKEditor doesn't support custom elements by default. In order to make them work, dtd needs to be modified (source code for dtd), ACF needs to be extended and new editor needs to be built. Please see: https://stackoverflow.com/questions/16066556/ckeditor-how-to-allow-for-inserthtmlcustomtag-myattr-value-customtag/16068708#16068708

Direct Source Code modification is required for block-level tags. For inline tags dtd can be modified before first editor initialization. Please see #14418 for code example.

With the above approach extra paragraphs will not be added.


Please note however that custom tags are not supported in the editor and although extending DTD will work, there might be some quirks related to the usage of these tags.

DUP of #14418.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy