CKEditor delete image with non-standard markup -
in ckeditor have xsl template (that why have xsl tags inside img). problem when delete image, tags inside img not deleted.
<span contenteditable="false"> <span contenteditable="true"> <img alt=" legenda" contenteditable="true" height="200px" id="legendimg" src="/rp/resources/css/images/tpl/legenda.png" width="400px"> <xsl:attribute contenteditable="false" name="src"><xsl:value-of contenteditable="false" select="legend"></xsl:value-of></xsl:attribute> </img> </span> </span>
after clicking image in editor , deleting get
<p><span contenteditable="false"> <span contenteditable="true"> <xsl:attribute contenteditable="false" name="src"> <xsl:value-of contenteditable="false" select="legend"> </xsl:value-of> </xsl:attribute></span></span></p>
i need pointers best approach fix problem. maybe there simple way of fixing it, or should listen kind of delete event.
first of all, cannot edit invalid html in wysiwyg editor ckeditor. uses native contenteditable
base of editing feature, e.g. delete handled browser (actually, may change in future, because of serious webkit's bugs).
although, it's not problem backspaces handling, because xsl tags removed inside image when ckeditor parsing , fixing loaded content. avoid try modify ckeditor's dtd object, still - hard whether browsers able handle correctly - i'm pretty sure of them won't.
so need remember in wysiwyg editor you're in fact editing real web page, need load content valid html. invalid parts can protect using config.protectedsource, image configured dtd empty tag may not accept protected source inside it.
Comments
Post a Comment