Skip to content

Commit cbb2348

Browse files
committed
Update @types/mdast, mdast utilities
1 parent 6a440d3 commit cbb2348

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

lib/index.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
*/
1111

1212
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'
13-
import {association} from 'mdast-util-to-markdown/lib/util/association.js'
14-
import {containerFlow} from 'mdast-util-to-markdown/lib/util/container-flow.js'
15-
import {indentLines} from 'mdast-util-to-markdown/lib/util/indent-lines.js'
16-
import {safe} from 'mdast-util-to-markdown/lib/util/safe.js'
17-
import {track} from 'mdast-util-to-markdown/lib/util/track.js'
1813

1914
footnoteReference.peek = footnoteReferencePeek
2015

@@ -146,12 +141,12 @@ function exitFootnoteCall(token) {
146141
* @param {FootnoteReference} node
147142
*/
148143
function footnoteReference(node, _, context, safeOptions) {
149-
const tracker = track(safeOptions)
144+
const tracker = context.createTracker(safeOptions)
150145
let value = tracker.move('[^')
151146
const exit = context.enter('footnoteReference')
152147
const subexit = context.enter('reference')
153148
value += tracker.move(
154-
safe(context, association(node), {
149+
context.safe(context.associationId(node), {
155150
...tracker.current(),
156151
before: value,
157152
after: ']'
@@ -173,12 +168,12 @@ function footnoteReferencePeek() {
173168
* @param {FootnoteDefinition} node
174169
*/
175170
function footnoteDefinition(node, _, context, safeOptions) {
176-
const tracker = track(safeOptions)
171+
const tracker = context.createTracker(safeOptions)
177172
let value = tracker.move('[^')
178173
const exit = context.enter('footnoteDefinition')
179174
const subexit = context.enter('label')
180175
value += tracker.move(
181-
safe(context, association(node), {
176+
context.safe(context.associationId(node), {
182177
...tracker.current(),
183178
before: value,
184179
after: ']'
@@ -190,7 +185,7 @@ function footnoteDefinition(node, _, context, safeOptions) {
190185
)
191186
tracker.shift(4)
192187
value += tracker.move(
193-
indentLines(containerFlow(node, context, tracker.current()), map)
188+
context.indentLines(context.containerFlow(node, tracker.current()), map)
194189
)
195190
exit()
196191

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
"index.js"
3636
],
3737
"dependencies": {
38-
"@types/mdast": "^3.0.0",
39-
"mdast-util-to-markdown": "^1.3.0",
40-
"micromark-util-normalize-identifier": "^1.0.0"
38+
"@types/mdast": "^4.0.0",
39+
"mdast-util-from-markdown": "^2.0.0",
40+
"mdast-util-to-markdown": "^2.0.0",
41+
"micromark-util-normalize-identifier": "^2.0.0"
4142
},
4243
"devDependencies": {
4344
"@types/node": "^20.0.0",
44-
"c8": "^7.0.0",
45-
"mdast-util-from-markdown": "^1.0.0",
46-
"micromark-extension-gfm-footnote": "^1.0.0",
45+
"c8": "^8.0.0",
46+
"micromark-extension-gfm-footnote": "^2.0.0",
4747
"prettier": "^2.0.0",
4848
"remark-cli": "^11.0.0",
4949
"remark-preset-wooorm": "^9.0.0",

test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ test('gfmFootnoteToMarkdown', () => {
229229
},
230230
{extensions: [gfmFootnoteToMarkdown()]}
231231
),
232-
'[^a]: b\n',
232+
'[^a]: ```\n b\n ```\n',
233233
'should serialize code in a footnote definition'
234234
)
235235

@@ -246,7 +246,7 @@ test('gfmFootnoteToMarkdown', () => {
246246
},
247247
{extensions: [gfmFootnoteToMarkdown()]}
248248
),
249-
'[^a]: b\n\n c\n',
249+
'[^a]: b\n\n ```\n c\n ```\n',
250250
'should serialize code as the 2nd child in a footnote definition'
251251
)
252252

0 commit comments

Comments
 (0)