@@ -13,7 +13,7 @@ module.exports = wrapper
13
13
14
14
var own = { } . hasOwnProperty
15
15
16
- /* Handlers. */
16
+ // Handlers.
17
17
var map = {
18
18
'#document' : root ,
19
19
'#document-fragment' : root ,
@@ -22,7 +22,7 @@ var map = {
22
22
'#documentType' : doctype
23
23
}
24
24
25
- /* Wrapper to normalise options. */
25
+ // Wrapper to normalise options.
26
26
function wrapper ( ast , options ) {
27
27
var settings = options || { }
28
28
var file
@@ -42,7 +42,7 @@ function wrapper(ast, options) {
42
42
} )
43
43
}
44
44
45
- /* Transform a node. */
45
+ // Transform a node.
46
46
function transform ( ast , config ) {
47
47
var schema = config . schema
48
48
var fn = own . call ( map , ast . nodeName ) ? map [ ast . nodeName ] : element
@@ -74,7 +74,7 @@ function transform(ast, config) {
74
74
return node
75
75
}
76
76
77
- /* Transform children. */
77
+ // Transform children.
78
78
function nodes ( children , config ) {
79
79
var length = children . length
80
80
var index = - 1
@@ -87,8 +87,8 @@ function nodes(children, config) {
87
87
return result
88
88
}
89
89
90
- /* Transform a document.
91
- * Stores `ast.quirksMode` in `node.data.quirksMode`. */
90
+ // Transform a document.
91
+ // Stores `ast.quirksMode` in `node.data.quirksMode`.
92
92
function root ( ast , children , config ) {
93
93
var node = { type : 'root' , children : children , data : { } }
94
94
var doc
@@ -111,7 +111,7 @@ function root(ast, children, config) {
111
111
return node
112
112
}
113
113
114
- /* Transform a doctype. */
114
+ // Transform a doctype.
115
115
function doctype ( ast ) {
116
116
return {
117
117
type : 'doctype' ,
@@ -121,17 +121,17 @@ function doctype(ast) {
121
121
}
122
122
}
123
123
124
- /* Transform a text. */
124
+ // Transform a text.
125
125
function text ( ast ) {
126
126
return { type : 'text' , value : ast . value }
127
127
}
128
128
129
- /* Transform a comment. */
129
+ // Transform a comment.
130
130
function comment ( ast ) {
131
131
return { type : 'comment' , value : ast . data }
132
132
}
133
133
134
- /* Transform an element. */
134
+ // Transform an element.
135
135
function element ( ast , children , config ) {
136
136
var fn = config . schema . space === 'svg' ? s : h
137
137
var name = ast . tagName
@@ -169,7 +169,7 @@ function element(ast, children, config) {
169
169
return node
170
170
}
171
171
172
- /* Create clean positional information. */
172
+ // Create clean positional information.
173
173
function location ( node , location , config ) {
174
174
var schema = config . schema
175
175
var verbose = config . verbose
@@ -183,7 +183,8 @@ function location(node, location, config) {
183
183
if ( node . type === 'element' ) {
184
184
reference = node . children [ node . children . length - 1 ]
185
185
186
- /* Unclosed with children (upstream: https://github.com/inikulin/parse5/issues/109) */
186
+ // Bug for unclosed with children.
187
+ // See: <https://github.com/inikulin/parse5/issues/109>.
187
188
if (
188
189
! location . endTag &&
189
190
reference &&
0 commit comments