File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,32 @@ import {createState} from './state.js'
26
26
/**
27
27
* Transform a hast tree (with embedded MDX nodes) into an estree.
28
28
*
29
- * ###### Notes
29
+ * ##### Notes
30
+ *
31
+ * ###### Comments
30
32
*
31
33
* Comments are attached to the tree in their neighbouring nodes (`recast`,
32
34
* `babel` style) and also added as a `comments` array on the program node
33
35
* (`espree` style).
34
36
* You may have to do `program.comments = undefined` for certain compilers.
35
37
*
38
+ * ###### Frameworks
39
+ *
40
+ * There are differences between what JSX frameworks accept, such as whether they
41
+ * accept `class` or `className`, or `background-color` or `backgroundColor`.
42
+ *
43
+ * For JSX components written in MDX, the author has to be aware of this
44
+ * difference and write code accordingly.
45
+ * For hast elements transformed by this project, this will be handled through
46
+ * options.
47
+ *
48
+ * | Framework | `elementAttributeNameCase` | `stylePropertyNameCase` |
49
+ * | --------- | -------------------------- | ----------------------- |
50
+ * | Preact | `'html'` | `'dom'` |
51
+ * | React | `'react'` | `'dom'` |
52
+ * | Solid | `'html'` | `'css'` |
53
+ * | Vue | `'html'` | `'dom'` |
54
+ *
36
55
* @param {Node } tree
37
56
* hast tree.
38
57
* @param {Options | null | undefined } [options]
Original file line number Diff line number Diff line change @@ -157,13 +157,32 @@ There is no default export.
157
157
Transform a hast tree (with embedded MDX nodes) into an estree (with JSX
158
158
nodes).
159
159
160
- ###### Notes
160
+ ##### Notes
161
+
162
+ ###### Comments
161
163
162
164
Comments are attached to the tree in their neighbouring nodes (` recast ` ,
163
165
` babel ` style) and also added as a ` comments ` array on the program node
164
166
(` espree ` style).
165
167
You may have to do ` program.comments = undefined ` for certain compilers.
166
168
169
+ ###### Frameworks
170
+
171
+ There are differences between what JSX frameworks accept, such as whether they
172
+ accept ` class ` or ` className ` , or ` background-color ` or ` backgroundColor ` .
173
+
174
+ For JSX components written in MDX, the author has to be aware of this
175
+ difference and write code accordingly.
176
+ For hast elements transformed by this project, this will be handled through
177
+ options.
178
+
179
+ | Framework | ` elementAttributeNameCase ` | ` stylePropertyNameCase ` |
180
+ | --------- | -------------------------- | ----------------------- |
181
+ | Preact | ` 'html' ` | ` 'dom' ` |
182
+ | React | ` 'react' ` | ` 'dom' ` |
183
+ | Solid | ` 'html' ` | ` 'css' ` |
184
+ | Vue | ` 'html' ` | ` 'dom' ` |
185
+
167
186
###### Parameters
168
187
169
188
* ` tree ` ([ ` HastNode ` ] [ hast-node ] )
You can’t perform that action at this time.
0 commit comments