File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ var domParserOptions = { decodeEntities: true, lowerCaseAttributeNames: false };
9
9
*
10
10
* @param {String } html - HTML string.
11
11
* @param {Object } [options] - Parser options.
12
+ * @param {Object } [options.htmlparser2] - htmlparser2 options.
12
13
* @param {Object } [options.library] - Library for React, Preact, etc.
13
14
* @param {Function } [options.replace] - Replace method.
14
15
* @return {JSX.Element|JSX.Element[]|String } - React element(s), empty array, or string.
@@ -20,7 +21,11 @@ function HTMLReactParser(html, options) {
20
21
if ( html === '' ) {
21
22
return [ ] ;
22
23
}
23
- return domToReact ( htmlToDOM ( html , domParserOptions ) , options ) ;
24
+ options = options || { } ;
25
+ return domToReact (
26
+ htmlToDOM ( html , options . htmlparser2 || domParserOptions ) ,
27
+ options
28
+ ) ;
24
29
}
25
30
26
31
HTMLReactParser . domToReact = domToReact ;
You can’t perform that action at this time.
0 commit comments