CKEditor 4 removes xlink:href in A tags even when allowedContent set to true -
i have use ckeditor allow users edit htlm pages may include svg images. , links defined in svg images contain attribute xlink:href. e.g:
<svg preserveaspectratio="xminymin meet" version="1.1" viewbox="0 0 778 873" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image height="100%" width="100%" xlink:href="map.png"></image> <g class="hover_group" opacity="1"> <a xlink:href="http://www.google.com"> <rect fill="red" height="100" opacity="0.0" width="160" x="110" y="240"></rect> </a> </g> </svg>
i set ckeditor.config.allowedcontent = true hope tags , attributes retained editor.
however, when switch , forth between wysiwyg , html mode, notice tag become this:
a href="http://www.google.com" xlink:=""
<svg preserveaspectratio="xminymin meet" version="1.1" viewbox="0 0 778 873" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image height="100%" width="100%" xlink:href="map.png"></image> <g class="hover_group" opacity="1"> <a href="http://www.google.com" xlink:=""> <rect fill="red" height="100" opacity="0.0" width="160" x="110" y="240"></rect> </a> </g> </svg>
this behavior happens tag, not image tag.
of course, makes link in svg file no longer work.
anyone know how fix this? thanks. don't want manually allow allowed tags or attributes because may work.
it bug (called "lack of feature") in ckeditor. it's not able process attributes ending ":href" properly.
i reported http://dev.ckeditor.com/ticket/13233 includes possible patch. if it's correct, issue fixed in next minor release.
Comments
Post a Comment