3
3
* @typedef {import('mdast').FootnoteReference } FootnoteReference
4
4
* @typedef {import('mdast').FootnoteDefinition } FootnoteDefinition
5
5
* @typedef {import('mdast-util-from-markdown').Extension } FromMarkdownExtension
6
+ * @typedef {import('mdast-util-from-markdown').CompileContext } CompileContext
6
7
* @typedef {import('mdast-util-from-markdown').Handle } FromMarkdownHandle
7
8
* @typedef {import('mdast-util-to-markdown').Options } ToMarkdownExtension
8
9
* @typedef {import('mdast-util-to-markdown').Handle } ToMarkdownHandle
@@ -46,20 +47,29 @@ export const footnoteToMarkdown = {
46
47
footnoteReference . peek = footnoteReferencePeek
47
48
footnote . peek = footnotePeek
48
49
49
- /** @type {FromMarkdownHandle } */
50
+ /**
51
+ * @this {CompileContext}
52
+ * @type {FromMarkdownHandle }
53
+ */
50
54
function enterFootnoteDefinition ( token ) {
51
55
this . enter (
52
56
{ type : 'footnoteDefinition' , identifier : '' , label : '' , children : [ ] } ,
53
57
token
54
58
)
55
59
}
56
60
57
- /** @type {FromMarkdownHandle } */
61
+ /**
62
+ * @this {CompileContext}
63
+ * @type {FromMarkdownHandle }
64
+ */
58
65
function enterFootnoteDefinitionLabelString ( ) {
59
66
this . buffer ( )
60
67
}
61
68
62
- /** @type {FromMarkdownHandle } */
69
+ /**
70
+ * @this {CompileContext}
71
+ * @type {FromMarkdownHandle }
72
+ */
63
73
function exitFootnoteDefinitionLabelString ( token ) {
64
74
const label = this . resume ( )
65
75
const node = /** @type {FootnoteDefinition } */ (
@@ -71,22 +81,34 @@ function exitFootnoteDefinitionLabelString(token) {
71
81
) . toLowerCase ( )
72
82
}
73
83
74
- /** @type {FromMarkdownHandle } */
84
+ /**
85
+ * @this {CompileContext}
86
+ * @type {FromMarkdownHandle }
87
+ */
75
88
function exitFootnoteDefinition ( token ) {
76
89
this . exit ( token )
77
90
}
78
91
79
- /** @type {FromMarkdownHandle } */
92
+ /**
93
+ * @this {CompileContext}
94
+ * @type {FromMarkdownHandle }
95
+ */
80
96
function enterFootnoteCall ( token ) {
81
97
this . enter ( { type : 'footnoteReference' , identifier : '' , label : '' } , token )
82
98
}
83
99
84
- /** @type {FromMarkdownHandle } */
100
+ /**
101
+ * @this {CompileContext}
102
+ * @type {FromMarkdownHandle }
103
+ */
85
104
function enterFootnoteCallString ( ) {
86
105
this . buffer ( )
87
106
}
88
107
89
- /** @type {FromMarkdownHandle } */
108
+ /**
109
+ * @this {CompileContext}
110
+ * @type {FromMarkdownHandle }
111
+ */
90
112
function exitFootnoteCallString ( token ) {
91
113
const label = this . resume ( )
92
114
const node = /** @type {FootnoteDefinition } */ (
@@ -98,17 +120,26 @@ function exitFootnoteCallString(token) {
98
120
) . toLowerCase ( )
99
121
}
100
122
101
- /** @type {FromMarkdownHandle } */
123
+ /**
124
+ * @this {CompileContext}
125
+ * @type {FromMarkdownHandle }
126
+ */
102
127
function exitFootnoteCall ( token ) {
103
128
this . exit ( token )
104
129
}
105
130
106
- /** @type {FromMarkdownHandle } */
131
+ /**
132
+ * @this {CompileContext}
133
+ * @type {FromMarkdownHandle }
134
+ */
107
135
function enterNote ( token ) {
108
136
this . enter ( { type : 'footnote' , children : [ ] } , token )
109
137
}
110
138
111
- /** @type {FromMarkdownHandle } */
139
+ /**
140
+ * @this {CompileContext}
141
+ * @type {FromMarkdownHandle }
142
+ */
112
143
function exitNote ( token ) {
113
144
this . exit ( token )
114
145
}
0 commit comments