19
19
* [ API] ( #api )
20
20
* [ ` toEstree(tree[, options]) ` ] ( #toestreetree-options )
21
21
* [ ` defaultHandlers ` ] ( #defaulthandlers )
22
+ * [ ` ElementAttributeNameCase ` ] ( #elementattributenamecase )
22
23
* [ ` Handle ` ] ( #handle )
23
24
* [ ` Options ` ] ( #options )
24
- * [ ` Space ` ] ( #space-1 )
25
+ * [ ` Space ` ] ( #space )
25
26
* [ ` State ` ] ( #state )
26
27
* [ Types] ( #types )
27
28
* [ Compatibility] ( #compatibility )
@@ -193,6 +194,19 @@ Default handlers for elements (`Record<string, Handle>`).
193
194
194
195
Each key is a node type, each value is a [ ` Handle ` ] [ handle ] .
195
196
197
+ ### ` ElementAttributeNameCase `
198
+
199
+ Specify casing to use for attribute names (TypeScript type).
200
+
201
+ React casing is for example ` className ` , ` strokeLinecap ` , ` xmlLang ` .
202
+ HTML casing is for example ` class ` , ` stroke-linecap ` , ` xml:lang ` .
203
+
204
+ ###### Type
205
+
206
+ ``` ts
207
+ type ElementAttributeNameCase = ' react' | ' html'
208
+ ` ` `
209
+
196
210
### ` Handle `
197
211
198
212
Turn a hast node into an estree node (TypeScript type).
@@ -214,23 +228,20 @@ You can also add more results to `state.esm` and `state.comments`.
214
228
215
229
Configuration (TypeScript type).
216
230
217
- ##### Fields
218
-
219
- ###### ` space `
220
-
221
- Which space the document is in ([ ` Space ` ] [ space ] , default: ` 'html' ` ).
222
-
223
- When an ` <svg> ` element is found in the HTML space, this package already
224
- automatically switches to and from the SVG space when entering and exiting
225
- it.
226
-
227
- ###### ` handlers `
228
-
229
- Object mapping node types to functions handling the corresponding nodes
230
- (` Record<string, Handle> ` , optional).
231
+ ###### Fields
231
232
232
- Merged into the defaults.
233
- See [ ` Handle ` ] [ handle ] .
233
+ * ` elementAttributeNameCase `
234
+ ([ ` ElementAttributeNameCase ` ][api-element-attribute-name-case], default:
235
+ ` ' react' ` )
236
+ — specify casing to use for attribute names; this casing is used for hast
237
+ elements, not for embedded MDX JSX nodes (components that someone authored
238
+ manually)
239
+ * ` handlers ` ( ` Record <string , Handle >` , optional)
240
+ — custom handlers
241
+ * ` space ` ([ ` Space ` ][space], default: ` ' html' ` ).
242
+ which space the document is in; when an ` <svg >` element is found in the
243
+ HTML space, this package already automatically switches to and from the SVG
244
+ space when entering and exiting it
234
245
235
246
### ` Space `
236
247
@@ -250,6 +261,9 @@ Info passed around about the current state (TypeScript type).
250
261
251
262
* ` schema ` ([ ` Schema ` ][schema])
252
263
— current schema
264
+ * ` elementAttributeNameCase `
265
+ ([ ` ElementAttributeNameCase ` ][api-element-attribute-name-case])
266
+ — casing to use for attribute names
253
267
* ` comments ` ( ` Array <EstreeComment >` )
254
268
— list of estree comments
255
269
* ` esm ` ( ` Array <EstreeNode >` )
@@ -271,7 +285,9 @@ Info passed around about the current state (TypeScript type).
271
285
## Types
272
286
273
287
This package is fully typed with [TypeScript][].
274
- It exports the additional types [ ` Handle ` ][handle], [ ` Options ` ][options],
288
+ It exports the additional types
289
+ [ ` ElementAttributeNameCase ` ][api-element-attribute-name-case],
290
+ [ ` Handle ` ][handle], [ ` Options ` ][options],
275
291
[ ` Space ` ][space], and [ ` State ` ][state].
276
292
277
293
## Compatibility
@@ -381,7 +397,9 @@ abide by its terms.
381
397
382
398
[toestree]: #toestreetree-options
383
399
384
- [space]: #space-1
400
+ [api-element-attribute-name-case]: #elementattributenamecase
401
+
402
+ [space]: #space
385
403
386
404
[options]: #options
387
405
0 commit comments