File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,11 @@ export interface HTMLReactParserOptions {
15
15
}
16
16
17
17
/**
18
- * Convert HTML string to React elements.
18
+ * Converts HTML string to React elements.
19
19
*
20
- * @param - Raw string of HTML to parse.
21
- * @param options - Options to use when converting to react.
22
- * @returns ReactElement on successful parse or string when `html` cannot be
23
- * parsed as HTML
20
+ * @param html - The HTML string to parse to React.
21
+ * @param options - The parser options.
22
+ * @return - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
24
23
*/
25
24
declare function HTMLReactParser (
26
25
html : string ,
Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ var htmlToDOM = require('html-dom-parser');
5
5
var domParserOptions = { decodeEntities : true , lowerCaseAttributeNames : false } ;
6
6
7
7
/**
8
- * Convert HTML string to React elements.
8
+ * Converts HTML string to React elements.
9
9
*
10
- * @param {String } html - The HTML string.
11
- * @param {Object } [options] - The additional options.
10
+ * @param {String } html - The HTML string to parse to React .
11
+ * @param {Object } [options] - The parser options.
12
12
* @param {Function } [options.replace] - The replace method.
13
- * @return {ReactElement|Array }
13
+ * @return {ReactElement|Array|String } - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
14
14
*/
15
15
function HTMLReactParser ( html , options ) {
16
16
if ( typeof html !== 'string' ) {
You can’t perform that action at this time.
0 commit comments