@@ -35,7 +35,7 @@ function domToReact(nodes, options) {
35
35
replaceElement = options . replace ( node ) ;
36
36
37
37
if ( isValidElement ( replaceElement ) ) {
38
- // specify a "key" prop if element has siblings
38
+ // set "key" prop for sibling elements
39
39
// https://fb.me/react-warning-keys
40
40
if ( len > 1 ) {
41
41
replaceElement = cloneElement ( replaceElement , {
@@ -62,14 +62,11 @@ function domToReact(nodes, options) {
62
62
63
63
props = node . attribs ;
64
64
if ( ! shouldPassAttributesUnaltered ( node ) ) {
65
- // update values
66
65
props = attributesToProps ( node . attribs ) ;
67
66
}
68
67
69
68
children = null ;
70
69
71
- // node type for <script> is "script"
72
- // node type for <style> is "style"
73
70
if ( node . type === 'script' || node . type === 'style' ) {
74
71
// prevent text in <script> or <style> from being escaped
75
72
// https://facebook.github.io/react/tips/dangerously-set-inner-html.html
@@ -94,7 +91,7 @@ function domToReact(nodes, options) {
94
91
continue ;
95
92
}
96
93
97
- // specify a "key" prop if element has siblings
94
+ // set "key" prop for sibling elements
98
95
// https://fb.me/react-warning-keys
99
96
if ( len > 1 ) {
100
97
props . key = i ;
@@ -107,6 +104,8 @@ function domToReact(nodes, options) {
107
104
}
108
105
109
106
/**
107
+ * Determines whether attributes should be altered or not.
108
+ *
110
109
* @param {React.ReactElement } node
111
110
* @return {Boolean }
112
111
*/
0 commit comments