@@ -68,8 +68,8 @@ internals away.
6868This utility adds [ fields on nodes] [ fields ] so that the utility responsible for
6969turning mdast (markdown) nodes into hast (HTML) nodes,
7070[ ` mdast-util-to-hast ` ] [ mdast-util-to-hast ] , turns text (inline) math nodes into
71- ` <span class="math math-inline">…</span > ` and flow (block) math nodes into
72- ` <div class="math math-display">…</div >` .
71+ ` <code class="language- math math-inline">…</code > ` and flow (block) math nodes
72+ into ` <pre><code class="language- math math-display">…</code></pre >` .
7373
7474## Install
7575
@@ -99,7 +99,8 @@ In browsers with [`esm.sh`][esmsh]:
9999Say our document ` example.md ` contains:
100100
101101``` markdown
102- Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation.
102+ Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following
103+ equation.
103104
104105$$
105106L = \frac{1}{2} \rho v^2 S C_L
@@ -142,8 +143,8 @@ brevity):
142143 {type: ' text' , value: ' Lift(' },
143144 {type: ' inlineMath' , value: ' L' , data: {/* … */ }},
144145 {type: ' text' , value: ' ) can be determined by Lift Coefficient (' },
145- {type: ' inlineMath' , e : ' C_L' , data: {/* … */ }},
146- {type: ' text' , value: ' ) like the following equation .' }
146+ {type: ' inlineMath' , value : ' C_L' , data: {/* … */ }},
147+ {type: ' text' , value: ' ) like the following\n equation .' }
147148 ]
148149 },
149150 {type: ' math' , meta: null , value: ' L = \\ frac{1}{2} \\ rho v^2 S C_L' , data: {/* … */ }}
@@ -152,7 +153,8 @@ brevity):
152153```
153154
154155``` markdown
155- Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation.
156+ Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following
157+ equation.
156158
157159$$
158160L = \frac{1}{2} \rho v^2 S C_L
@@ -196,11 +198,14 @@ Math (text) (TypeScript type).
196198###### Type
197199
198200``` ts
199- import type {Literal } from ' mdast'
201+ import type {Data , Literal } from ' mdast'
200202
201203interface InlineMath extends Literal {
202204 type: ' inlineMath'
205+ data? : InlineMathData | undefined
203206}
207+
208+ export interface InlineMathData extends Data {}
204209```
205210
206211### ` Math `
@@ -210,12 +215,15 @@ Math (flow) (TypeScript type).
210215###### Type
211216
212217``` ts
213- import type {Literal } from ' mdast'
218+ import type {Data , Literal } from ' mdast'
214219
215220interface Math extends Literal {
216221 type: ' math'
217222 meta? : string | null | undefined
223+ data? : MathData | undefined
218224}
225+
226+ export interface MathData extends Data {}
219227```
220228
221229### ` ToOptions `
@@ -234,8 +242,8 @@ Configuration (TypeScript type).
234242
235243This plugin integrates with [ ` mdast-util-to-hast ` ] [ mdast-util-to-hast ] .
236244When mdast is turned into hast the math nodes are turned into
237- ` <span class="math math-inline">…</span > ` and
238- ` <div class="math math-display">…</div > ` elements.
245+ ` <code class="language- math math-inline">…</code > ` and
246+ ` <pre><code class="language- math math-display">…</code></pre > ` elements.
239247
240248## Syntax
241249
0 commit comments