html-react-parser 3.0.5 → 3.0.7
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/README.md +1 -1
- package/dist/html-react-parser.js +13 -4
- 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 +5 -1
- package/lib/attributes-to-props.js +3 -1
- package/lib/dom-to-react.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -531,7 +531,7 @@ npx size-limit
|
|
|
531
531
|
|
|
532
532
|
### Code Contributors
|
|
533
533
|
|
|
534
|
-
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/remarkablemark/html-react-parser/blob/master/CONTRIBUTING.md)].
|
|
534
|
+
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/remarkablemark/html-react-parser/blob/master/.github/CONTRIBUTING.md)].
|
|
535
535
|
|
|
536
536
|
[](https://github.com/remarkablemark/html-react-parser/graphs/contributors)
|
|
537
537
|
|
|
@@ -1913,6 +1913,12 @@
|
|
|
1913
1913
|
|
|
1914
1914
|
var cjs = {};
|
|
1915
1915
|
|
|
1916
|
+
var styleToObjectExports = {};
|
|
1917
|
+
var styleToObject = {
|
|
1918
|
+
get exports(){ return styleToObjectExports; },
|
|
1919
|
+
set exports(v){ styleToObjectExports = v; },
|
|
1920
|
+
};
|
|
1921
|
+
|
|
1916
1922
|
// http://www.w3.org/TR/CSS21/grammar.html
|
|
1917
1923
|
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
|
|
1918
1924
|
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
|
@@ -2212,7 +2218,8 @@
|
|
|
2212
2218
|
return output;
|
|
2213
2219
|
}
|
|
2214
2220
|
|
|
2215
|
-
|
|
2221
|
+
styleToObject.exports = StyleToObject;
|
|
2222
|
+
styleToObjectExports.default = StyleToObject; // ESM support
|
|
2216
2223
|
|
|
2217
2224
|
var utilities$3 = {};
|
|
2218
2225
|
|
|
@@ -2253,7 +2260,7 @@
|
|
|
2253
2260
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2254
2261
|
};
|
|
2255
2262
|
exports.__esModule = true;
|
|
2256
|
-
var style_to_object_1 = __importDefault(
|
|
2263
|
+
var style_to_object_1 = __importDefault(styleToObjectExports);
|
|
2257
2264
|
var utilities_1 = utilities$3;
|
|
2258
2265
|
function StyleToJS(style, options) {
|
|
2259
2266
|
var output = {};
|
|
@@ -2408,9 +2415,10 @@
|
|
|
2408
2415
|
* Converts HTML/SVG DOM attributes to React props.
|
|
2409
2416
|
*
|
|
2410
2417
|
* @param {object} [attributes={}] - HTML/SVG DOM attributes.
|
|
2418
|
+
* @param {string} [nodeName] - DOM node name.
|
|
2411
2419
|
* @returns - React props.
|
|
2412
2420
|
*/
|
|
2413
|
-
var attributesToProps$2 = function attributesToProps(attributes) {
|
|
2421
|
+
var attributesToProps$2 = function attributesToProps(attributes, nodeName) {
|
|
2414
2422
|
attributes = attributes || {};
|
|
2415
2423
|
|
|
2416
2424
|
var valueOnlyInputs = {
|
|
@@ -2446,6 +2454,7 @@
|
|
|
2446
2454
|
// https://reactjs.org/docs/uncontrolled-components.html
|
|
2447
2455
|
if (
|
|
2448
2456
|
(propName === 'checked' || propName === 'value') &&
|
|
2457
|
+
nodeName !== 'option' &&
|
|
2449
2458
|
!inputIsValueOnly
|
|
2450
2459
|
) {
|
|
2451
2460
|
propName = getPropName('default' + attributeNameLowerCased);
|
|
@@ -2566,7 +2575,7 @@
|
|
|
2566
2575
|
if (skipAttributesToProps(node)) {
|
|
2567
2576
|
setStyleProp(props.style, props);
|
|
2568
2577
|
} else if (props) {
|
|
2569
|
-
props = attributesToProps$1(props);
|
|
2578
|
+
props = attributesToProps$1(props, node.name);
|
|
2570
2579
|
}
|
|
2571
2580
|
|
|
2572
2581
|
children = null;
|