From 5db88c0e5343769eefec7c5f9461d4f029ce8ebe Mon Sep 17 00:00:00 2001 From: shaunfreeman Date: Wed, 3 Apr 2013 14:15:47 +0100 Subject: [PATCH 1/2] added an option to allow all classes when paring, this is a fix for #219 --- src/dom/parse.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dom/parse.js b/src/dom/parse.js index f7868f94..706cf057 100644 --- a/src/dom/parse.js +++ b/src/dom/parse.js @@ -214,6 +214,7 @@ wysihtml5.dom.parse = (function() { setAttributes = rule.set_attributes, // attributes to set on the current node checkAttributes = rule.check_attributes, // check/convert values of attributes allowedClasses = currentRules.classes, + allowEveryClasses = currentRules.allowAllClasses, i = 0, classes = [], newClasses = [], @@ -272,7 +273,7 @@ wysihtml5.dom.parse = (function() { classesLength = classes.length; for (; i Date: Wed, 3 Apr 2013 18:27:43 +0100 Subject: [PATCH 2/2] updated allowed classes to something better, added allow atrributes --- src/dom/parse.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/dom/parse.js b/src/dom/parse.js index 706cf057..91e5aea3 100644 --- a/src/dom/parse.js +++ b/src/dom/parse.js @@ -213,8 +213,8 @@ wysihtml5.dom.parse = (function() { addClass = rule.add_class, // add classes based on existing attributes setAttributes = rule.set_attributes, // attributes to set on the current node checkAttributes = rule.check_attributes, // check/convert values of attributes + allowAttributes = rule.allow_attributes, // copy attributes from old to new node allowedClasses = currentRules.classes, - allowEveryClasses = currentRules.allowAllClasses, i = 0, classes = [], newClasses = [], @@ -232,6 +232,17 @@ wysihtml5.dom.parse = (function() { attributes = wysihtml5.lang.object(setAttributes).clone(); } + if (allowAttributes) { + allowAttributesLength = allowAttributes.length; + for (i = 0; i