summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-02-22 03:31:01 (GMT)
committerNathaniel Catchpole2016-02-22 03:31:01 (GMT)
commit03d49cf715371596e53a424d64056969c8df1927 (patch)
tree19f9063beeb856f81d1d5a0607404450b91faaf7
parent4b8acaab95462f077fa488ae9037a6b8b7b14e15 (diff)
Issue #2669898 by thpoul, DuaelFr, Wim Leers: cke_widget_element CSS Class get wrongly returned by the drupallink plugin
-rw-r--r--core/modules/ckeditor/js/plugins/drupallink/plugin.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/modules/ckeditor/js/plugins/drupallink/plugin.js b/core/modules/ckeditor/js/plugins/drupallink/plugin.js
index 21b7fa2..e3ddcaf 100644
--- a/core/modules/ckeditor/js/plugins/drupallink/plugin.js
+++ b/core/modules/ckeditor/js/plugins/drupallink/plugin.js
@@ -18,15 +18,20 @@
for (var attrIndex = 0; attrIndex < domElement.attributes.length; attrIndex++) {
attribute = domElement.attributes.item(attrIndex);
attributeName = attribute.nodeName.toLowerCase();
- // Don't consider data-cke-saved- attributes; they're just there to work
- // around browser quirks.
- if (attributeName.substring(0, 15) === 'data-cke-saved-') {
+ // Ignore data-cke-* attributes; they're CKEditor internals.
+ if (attributeName.indexOf('data-cke-') === 0) {
continue;
}
// Store the value for this attribute, unless there's a data-cke-saved-
// alternative for it, which will contain the quirk-free, original value.
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;
}