html-react-parser 3.0.4 → 3.0.6

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/index.d.ts CHANGED
@@ -1,22 +1,23 @@
1
1
  // TypeScript Version: 4.7
2
+ /* eslint-disable no-undef, no-unused-vars */
2
3
 
3
- import { ParserOptions } from 'htmlparser2';
4
4
  import {
5
5
  Comment,
6
- DomHandlerOptions,
7
6
  Element,
8
7
  Node,
9
8
  ProcessingInstruction,
10
- Text
9
+ Text,
10
+ type DomHandlerOptions
11
11
  } from 'domhandler';
12
12
  import htmlToDOM from 'html-dom-parser';
13
+ import { ParserOptions } from 'htmlparser2';
13
14
 
14
15
  import attributesToProps from './lib/attributes-to-props';
15
16
  import domToReact from './lib/dom-to-react';
16
17
 
17
18
  export { attributesToProps, domToReact, htmlToDOM };
18
19
  export type HTMLParser2Options = ParserOptions & DomHandlerOptions;
19
- export { Comment, Element, Node, ProcessingInstruction, Text };
20
+ export { Comment, Element, ProcessingInstruction, Text };
20
21
  export type DOMNode = Comment | Element | Node | ProcessingInstruction | Text;
21
22
 
22
23
  export interface HTMLReactParserOptions {
package/index.js CHANGED
@@ -1,7 +1,9 @@
1
- var domToReact = require('./lib/dom-to-react');
2
- var attributesToProps = require('./lib/attributes-to-props');
1
+ var domhandler = require('domhandler');
3
2
  var htmlToDOM = require('html-dom-parser');
4
3
 
4
+ var attributesToProps = require('./lib/attributes-to-props');
5
+ var domToReact = require('./lib/dom-to-react');
6
+
5
7
  // support backwards compatibility for ES Module
6
8
  htmlToDOM =
7
9
  /* istanbul ignore next */
@@ -36,7 +38,12 @@ function HTMLReactParser(html, options) {
36
38
  HTMLReactParser.domToReact = domToReact;
37
39
  HTMLReactParser.htmlToDOM = htmlToDOM;
38
40
  HTMLReactParser.attributesToProps = attributesToProps;
39
- HTMLReactParser.Element = require('domhandler').Element;
41
+
42
+ // domhandler
43
+ HTMLReactParser.Comment = domhandler.Comment;
44
+ HTMLReactParser.Element = domhandler.Element;
45
+ HTMLReactParser.ProcessingInstruction = domhandler.ProcessingInstruction;
46
+ HTMLReactParser.Text = domhandler.Text;
40
47
 
41
48
  // support CommonJS and ES Modules
42
49
  module.exports = HTMLReactParser;
package/index.mjs CHANGED
@@ -3,6 +3,11 @@ import HTMLReactParser from './index.js';
3
3
  export var domToReact = HTMLReactParser.domToReact;
4
4
  export var htmlToDOM = HTMLReactParser.htmlToDOM;
5
5
  export var attributesToProps = HTMLReactParser.attributesToProps;
6
+
7
+ // domhandler
8
+ export var Comment = HTMLReactParser.Comment;
6
9
  export var Element = HTMLReactParser.Element;
10
+ export var ProcessingInstruction = HTMLReactParser.ProcessingInstruction;
11
+ export var Text = HTMLReactParser.Text;
7
12
 
8
13
  export default HTMLReactParser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-react-parser",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "HTML to React parser.",
5
5
  "author": "Mark <mark@remarkablemark.org>",
6
6
  "main": "index.js",
@@ -47,34 +47,34 @@
47
47
  "domhandler": "5.0.3",
48
48
  "html-dom-parser": "3.1.2",
49
49
  "react-property": "2.0.0",
50
- "style-to-js": "1.1.1"
50
+ "style-to-js": "1.1.2"
51
51
  },
52
52
  "devDependencies": {
53
- "@commitlint/cli": "17.0.3",
54
- "@commitlint/config-conventional": "17.0.3",
55
- "@rollup/plugin-commonjs": "22.0.2",
56
- "@rollup/plugin-node-resolve": "13.3.0",
57
- "@size-limit/preset-big-lib": "7.0.8",
58
- "@types/react": "18.0.17",
59
- "@typescript-eslint/parser": "5.33.1",
53
+ "@commitlint/cli": "17.3.0",
54
+ "@commitlint/config-conventional": "17.3.0",
55
+ "@rollup/plugin-commonjs": "24.0.0",
56
+ "@rollup/plugin-node-resolve": "15.0.1",
57
+ "@size-limit/preset-big-lib": "8.1.0",
58
+ "@types/react": "18.0.26",
59
+ "@typescript-eslint/parser": "5.47.0",
60
60
  "benchmark": "2.1.4",
61
61
  "dtslint": "4.2.1",
62
- "eslint": "8.22.0",
62
+ "eslint": "8.30.0",
63
63
  "eslint-plugin-prettier": "4.2.1",
64
- "husky": "8.0.1",
65
- "jest": "28.1.3",
66
- "jest-environment-jsdom": "28.1.3",
67
- "lint-staged": "13.0.3",
64
+ "husky": "8.0.2",
65
+ "jest": "29.3.1",
66
+ "jest-environment-jsdom": "29.3.1",
67
+ "lint-staged": "13.1.0",
68
68
  "pinst": "3.0.0",
69
- "preact": "10.10.6",
70
- "prettier": "2.7.1",
69
+ "preact": "10.11.3",
70
+ "prettier": "2.8.1",
71
71
  "react": "18.2.0",
72
72
  "react-dom": "18.2.0",
73
73
  "rimraf": "3.0.2",
74
- "rollup": "2.78.1",
74
+ "rollup": "2.79.1",
75
75
  "rollup-plugin-terser": "7.0.2",
76
- "size-limit": "7.0.8",
77
- "typescript": "4.7.4"
76
+ "size-limit": "8.1.0",
77
+ "typescript": "4.9.4"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "react": "0.14 || 15 || 16 || 17 || 18"