File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 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 };
99 *
1010 * @param {String } html - HTML string.
1111 * @param {Object } [options] - Parser options.
12+ * @param {Object } [options.htmlparser2] - htmlparser2 options.
1213 * @param {Object } [options.library] - Library for React, Preact, etc.
1314 * @param {Function } [options.replace] - Replace method.
1415 * @return {JSX.Element|JSX.Element[]|String } - React element(s), empty array, or string.
@@ -20,7 +21,11 @@ function HTMLReactParser(html, options) {
2021 if ( html === '' ) {
2122 return [ ] ;
2223 }
23- return domToReact ( htmlToDOM ( html , domParserOptions ) , options ) ;
24+ options = options || { } ;
25+ return domToReact (
26+ htmlToDOM ( html , options . htmlparser2 || domParserOptions ) ,
27+ options
28+ ) ;
2429}
2530
2631HTMLReactParser . domToReact = domToReact ;
You can’t perform that action at this time.
0 commit comments