@@ -58,19 +58,19 @@ allAttributes = new Set([...allAttributes].sort())
5858
5959for ( const name of htmlTagNames ) {
6060 /** @type {Record<string, string> } */
61- const props = { }
61+ const properties_ = { }
6262
6363 for ( const attribute of allAttributes ) {
64- props [ attribute ] = 'x'
64+ properties_ [ attribute ] = 'x'
6565 }
6666
67- delete props . type
67+ delete properties_ . type
6868
6969 if ( root . children . length > 0 ) {
7070 root . children . push ( { type : 'text' , value : '\n\n' } )
7171 }
7272
73- let element = h ( name , props , [ ] )
73+ let element = h ( name , properties_ , [ ] )
7474
7575 if ( Object . hasOwn ( schemaAncestors , name ) ) {
7676 const ancestor = schemaAncestors [ name ] [ 0 ]
@@ -152,30 +152,30 @@ visit(tree, function (node) {
152152 )
153153
154154 /** @type {string } */
155- let prop
155+ let property
156156
157- for ( prop in node . properties ) {
158- if ( Object . hasOwn ( node . properties , prop ) ) {
159- let value = node . properties [ prop ]
157+ for ( property in node . properties ) {
158+ if ( Object . hasOwn ( node . properties , property ) ) {
159+ let value = node . properties [ property ]
160160
161- if ( prop === 'dir' && value === 'auto' ) {
161+ if ( property === 'dir' && value === 'auto' ) {
162162 continue
163163 }
164164
165165 if (
166166 node . tagName === 'img' &&
167- prop === 'style' &&
167+ property === 'style' &&
168168 value === 'max-width: 100%;'
169169 ) {
170170 continue
171171 }
172172
173- propertyNamesSeen . add ( prop )
173+ propertyNamesSeen . add ( property )
174174
175175 assert (
176- entries . has ( prop ) ,
176+ entries . has ( property ) ,
177177 'property `' +
178- prop +
178+ property +
179179 '` was found in GH response (on `' +
180180 node . tagName +
181181 '`) but not defined in `schema.attributes` (global or specific to the element)'
@@ -187,9 +187,9 @@ visit(tree, function (node) {
187187
188188 if ( value === 'user-content-x' ) {
189189 assert (
190- schemaClobber . includes ( prop ) ,
190+ schemaClobber . includes ( property ) ,
191191 'property `' +
192- prop +
192+ property +
193193 '` was found in GH response (on `' +
194194 node . tagName +
195195 '`) with a clobber prefix, but not defined in `schema.clobber`'
@@ -204,36 +204,42 @@ visit(tree, function (node) {
204204 // Value GH sets it to with a clobber prefix.
205205 value === 'user-content-x' ||
206206 // Wrapper for images.
207- ( node . tagName === 'a' && prop === 'target' && value === '_blank' ) ||
208- ( node . tagName === 'a' && prop === 'rel' && value === 'noopener' ) ||
207+ ( node . tagName === 'a' &&
208+ property === 'target' &&
209+ value === '_blank' ) ||
210+ ( node . tagName === 'a' &&
211+ property === 'rel' &&
212+ value === 'noopener' ) ||
209213 // Footnotes.
210214 ( node . tagName === 'a' &&
211- prop === 'ariaDescribedBy' &&
215+ property === 'ariaDescribedBy' &&
212216 value === 'footnote-label' ) ||
213217 ( node . tagName === 'a' &&
214- prop === 'href' &&
218+ property === 'href' &&
215219 String ( value ) . startsWith ( 'x-' ) ) ||
216220 ( node . tagName === 'a' &&
217- prop === 'id' &&
221+ property === 'id' &&
218222 String ( value ) . startsWith ( 'user-content-x-' ) ) ||
219223 ( node . tagName === 'a' &&
220- prop === 'className' &&
224+ property === 'className' &&
221225 value === 'data-footnote-backref' ) ||
222226 ( node . tagName === 'section' &&
223- prop === 'className' &&
227+ property === 'className' &&
224228 value === 'footnotes' ) ||
225229 ( node . tagName === 'h2' &&
226- prop === 'id' &&
230+ property === 'id' &&
227231 ( value === 'footnote-label' ||
228232 value === 'user-content-footnote-label' ) ) ||
229- ( node . tagName === 'h2' && prop === 'className' && value === 'sr-only' )
233+ ( node . tagName === 'h2' &&
234+ property === 'className' &&
235+ value === 'sr-only' )
230236 ) {
231237 continue
232238 }
233239
234240 console . log (
235241 'Unexpected key `%s` (`%s`) on <%s>' ,
236- prop ,
242+ property ,
237243 value ,
238244 node . tagName
239245 )
0 commit comments