Commit 03d49cf7 authored by catch's avatar catch

Issue #2669898 by thpoul, DuaelFr, Wim Leers: cke_widget_element CSS Class get...

Issue #2669898 by thpoul, DuaelFr, Wim Leers: cke_widget_element CSS Class get wrongly returned by the drupallink plugin
parent 4b8acaab
...@@ -18,15 +18,20 @@ ...@@ -18,15 +18,20 @@
for (var attrIndex = 0; attrIndex < domElement.attributes.length; attrIndex++) { for (var attrIndex = 0; attrIndex < domElement.attributes.length; attrIndex++) {
attribute = domElement.attributes.item(attrIndex); attribute = domElement.attributes.item(attrIndex);
attributeName = attribute.nodeName.toLowerCase(); attributeName = attribute.nodeName.toLowerCase();
// Don't consider data-cke-saved- attributes; they're just there to work // Ignore data-cke-* attributes; they're CKEditor internals.
// around browser quirks. if (attributeName.indexOf('data-cke-') === 0) {
if (attributeName.substring(0, 15) === 'data-cke-saved-') {
continue; continue;
} }
// Store the value for this attribute, unless there's a data-cke-saved- // Store the value for this attribute, unless there's a data-cke-saved-
// alternative for it, which will contain the quirk-free, original value. // alternative for it, which will contain the quirk-free, original value.
parsedAttributes[attributeName] = element.data('cke-saved-' + attributeName) || attribute.nodeValue; parsedAttributes[attributeName] = element.data('cke-saved-' + attributeName) || attribute.nodeValue;
} }
// Remove any cke_* classes.
if (parsedAttributes.class) {
parsedAttributes.class = CKEDITOR.tools.trim(parsedAttributes.class.replace(/cke_\S+/, ''));
}
return parsedAttributes; return parsedAttributes;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment