html-react-parser 6.1.4 → 6.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/html-react-parser.js +11 -26
- package/dist/html-react-parser.js.map +1 -1
- package/dist/html-react-parser.min.js +1 -1
- package/dist/html-react-parser.min.js.map +1 -1
- package/lib/attributes-to-props.d.ts.map +1 -1
- package/lib/attributes-to-props.js.map +1 -1
- package/package.json +14 -14
- package/src/attributes-to-props.ts +1 -2
|
@@ -2057,7 +2057,7 @@
|
|
|
2057
2057
|
|
|
2058
2058
|
// http://www.w3.org/TR/CSS21/grammar.html
|
|
2059
2059
|
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
|
|
2060
|
-
var COMMENT_REGEX = /\/\*[^*]
|
|
2060
|
+
var COMMENT_REGEX = /\/\*(?:[^*]|\*(?!\/))*\*\//g;
|
|
2061
2061
|
|
|
2062
2062
|
var NEWLINE_REGEX = /\n/g;
|
|
2063
2063
|
var WHITESPACE_REGEX = /^\s*/;
|
|
@@ -2065,12 +2065,10 @@
|
|
|
2065
2065
|
// declaration
|
|
2066
2066
|
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
|
|
2067
2067
|
var COLON_REGEX = /^:\s*/;
|
|
2068
|
-
var VALUE_REGEX =
|
|
2068
|
+
var VALUE_REGEX =
|
|
2069
|
+
/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/;
|
|
2069
2070
|
var SEMICOLON_REGEX = /^[;\s]*/;
|
|
2070
2071
|
|
|
2071
|
-
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
|
|
2072
|
-
var TRIM_REGEX = /^\s+|\s+$/g;
|
|
2073
|
-
|
|
2074
2072
|
// strings
|
|
2075
2073
|
var NEWLINE = '\n';
|
|
2076
2074
|
var FORWARD_SLASH = '/';
|
|
@@ -2194,16 +2192,13 @@
|
|
|
2194
2192
|
/**
|
|
2195
2193
|
* Parse comments.
|
|
2196
2194
|
*
|
|
2197
|
-
* @param {Object[]}
|
|
2195
|
+
* @param {Object[]} rules
|
|
2198
2196
|
* @return {Object[]}
|
|
2199
2197
|
*/
|
|
2200
2198
|
function comments(rules) {
|
|
2201
2199
|
var c;
|
|
2202
|
-
rules = rules || [];
|
|
2203
2200
|
while ((c = comment())) {
|
|
2204
|
-
|
|
2205
|
-
rules.push(c);
|
|
2206
|
-
}
|
|
2201
|
+
rules.push(c);
|
|
2207
2202
|
}
|
|
2208
2203
|
return rules;
|
|
2209
2204
|
}
|
|
@@ -2265,9 +2260,9 @@
|
|
|
2265
2260
|
|
|
2266
2261
|
var ret = pos({
|
|
2267
2262
|
type: TYPE_DECLARATION,
|
|
2268
|
-
property:
|
|
2263
|
+
property: prop[0].replace(COMMENT_REGEX, EMPTY_STRING).trim(),
|
|
2269
2264
|
value: val
|
|
2270
|
-
?
|
|
2265
|
+
? val[0].replace(COMMENT_REGEX, EMPTY_STRING).trim()
|
|
2271
2266
|
: EMPTY_STRING
|
|
2272
2267
|
});
|
|
2273
2268
|
|
|
@@ -2290,10 +2285,8 @@
|
|
|
2290
2285
|
// declarations
|
|
2291
2286
|
var decl;
|
|
2292
2287
|
while ((decl = declaration())) {
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
comments(decls);
|
|
2296
|
-
}
|
|
2288
|
+
decls.push(decl);
|
|
2289
|
+
comments(decls);
|
|
2297
2290
|
}
|
|
2298
2291
|
|
|
2299
2292
|
return decls;
|
|
@@ -2303,16 +2296,6 @@
|
|
|
2303
2296
|
return declarations();
|
|
2304
2297
|
}
|
|
2305
2298
|
|
|
2306
|
-
/**
|
|
2307
|
-
* Trim `str`.
|
|
2308
|
-
*
|
|
2309
|
-
* @param {String} str
|
|
2310
|
-
* @return {String}
|
|
2311
|
-
*/
|
|
2312
|
-
function trim(str) {
|
|
2313
|
-
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
2299
|
cjs$1 = index;
|
|
2317
2300
|
|
|
2318
2301
|
return cjs$1;
|
|
@@ -2459,6 +2442,8 @@
|
|
|
2459
2442
|
}
|
|
2460
2443
|
//#endregion
|
|
2461
2444
|
dist = StyleToJS;
|
|
2445
|
+
|
|
2446
|
+
|
|
2462
2447
|
return dist;
|
|
2463
2448
|
}
|
|
2464
2449
|
|