File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
vendor/assets/javascripts Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -4899,6 +4899,7 @@ wysihtml5.dom.parse = (function() {
4899
4899
var attributes = { } , // fresh new set of attributes to set on newNode
4900
4900
setClass = rule . set_class , // classes to set
4901
4901
addClass = rule . add_class , // add classes based on existing attributes
4902
+ allowAttributes = rule . allow_attributes , // copy attributes from old to new node
4902
4903
setAttributes = rule . set_attributes , // attributes to set on the current node
4903
4904
checkAttributes = rule . check_attributes , // check/convert values of attributes
4904
4905
allowedClasses = currentRules . classes ,
@@ -4918,6 +4919,17 @@ wysihtml5.dom.parse = (function() {
4918
4919
if ( setAttributes ) {
4919
4920
attributes = wysihtml5 . lang . object ( setAttributes ) . clone ( ) ;
4920
4921
}
4922
+
4923
+ if ( allowAttributes ) {
4924
+ allowAttributesLength = allowAttributes . length ;
4925
+ for ( i = 0 ; i < allowAttributesLength ; i ++ ) {
4926
+ attributeName = allowAttributes [ i ] ;
4927
+ newAttributeValue = _getAttribute ( oldNode , attributeName ) ;
4928
+ if ( typeof ( newAttributeValue ) === "string" ) {
4929
+ attributes [ attributeName ] = newAttributeValue ;
4930
+ }
4931
+ }
4932
+ }
4921
4933
4922
4934
if ( checkAttributes ) {
4923
4935
for ( attributeName in checkAttributes ) {
You can’t perform that action at this time.
0 commit comments