Opened 11 years ago
Closed 10 years ago
#13233 closed Bug (fixed)
HTMLDataProcessor cannot process foo:href attributes
| Reported by: | Piotrek Koszuliński | Owned by: | Piotrek Koszuliński |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 4.4.8 |
| Component: | General | Version: | |
| Keywords: | Cc: |
Description
Try loading the following source into editor with ACF disabled:
<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>
The xlink:href attribute will be broken.
It seems that this regexp is a problem: https://github.com/ckeditor/ckeditor-dev/blob/2fbdbad72248e4b87826319c5e4a5a8e4b86f518/core/htmldataprocessor.js#L771
It allows only hyphens in attributes while colons should be accepted as well:
protectAttributeRegex = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
With this regexp the xlink:href attribute is correctly preserved.
Change History (5)
comment:1 Changed 11 years ago by
| Status: | new → confirmed |
|---|
comment:2 Changed 11 years ago by
comment:3 Changed 10 years ago by
| Owner: | set to Piotrek Koszuliński |
|---|---|
| Status: | confirmed → assigned |

Reported on http://stackoverflow.com/questions/29948676/ckeditor-4-removes-xlinkhref-in-a-tags-even-when-allowedcontent-set-to-true