File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,15 @@ function render (tree, options) {
49
49
50
50
var closingSingleTag = options . closingSingleTag
51
51
var quoteAllAttributes = options . quoteAllAttributes
52
- if ( typeof quoteAllAttributes === ' undefined' ) {
52
+ if ( quoteAllAttributes === undefined ) {
53
53
quoteAllAttributes = true
54
54
}
55
55
56
+ var replaceQuote = options . replaceQuote
57
+ if ( replaceQuote === undefined ) {
58
+ replaceQuote = true
59
+ }
60
+
56
61
return html ( tree )
57
62
58
63
/** @private */
@@ -77,7 +82,12 @@ function render (tree, options) {
77
82
for ( var key in obj ) {
78
83
if ( typeof obj [ key ] === 'string' ) {
79
84
if ( quoteAllAttributes || obj [ key ] . match ( ATTRIBUTE_QUOTES_REQUIRED ) ) {
80
- attr += ' ' + key + '="' + obj [ key ] . replace ( / " / g, '"' ) + '"'
85
+ var attrValue = obj [ key ]
86
+
87
+ if ( replaceQuote ) {
88
+ attrValue = obj [ key ] . replace ( / " / g, '"' )
89
+ }
90
+ attr += ' ' + key + '="' + attrValue + '"'
81
91
} else if ( obj [ key ] === '' ) {
82
92
attr += ' ' + key
83
93
} else {
You can’t perform that action at this time.
0 commit comments