Opened 8 years ago

Closed 8 years ago

#8782 closed Bug (wontfix)

html parser removes empty spans with attributes

Reported by: alissa Owned by:
Priority: Normal Milestone:
Component: Core : Parser Version:
Keywords: Cc:

Description

Hi When adding styled break-lines to the text, the html parser removes the empty spans inside the paragraphs and therefore the break-lines loose their styles (height) The issues is in the onTagOpen function which checks if this type of element, when empty should be removed, and ignores the fact that the element might have attributes. Thanks

Change History (1)

comment:1 Changed 8 years ago by Jakub Ś

Keywords: remove styles from empty elements removed
Resolution: wontfix
Status: newclosed
Version: 3.6.2

This is how CKEditor works by default - it removes empty inline styles.

I'm not sure why do you want to keep span tags aside. The natural way would be wrapping text inside them.
If you really want to use this techniques than the only thing I can suggest is using space inside span tags: <span style="line-height: 30px;">&nbsp;</span> test<br /> This however will result in visible space before text so it’s not really recommended.

Another workaround (which is in accordance with CKEditor logic) is using one of the below:

<div style="height: 30px;"> test</div>
<p style="height: 30px;"> test</p>
<span style="line-height: 30px;">test</span>

NOTE: they all require you to have text inside tags.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy