File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,17 @@ export type {Options} from './lib/index.js'
2
2
3
3
export { gfmTableFromMarkdown , gfmTableToMarkdown } from './lib/index.js'
4
4
5
+ // Add custom data tracked to turn markdown into a tree.
6
+ declare module 'mdast-util-from-markdown' {
7
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
8
+ interface CompileData {
9
+ /**
10
+ * Whether we’re currently in a table.
11
+ */
12
+ inTable ?: boolean | undefined
13
+ }
14
+ }
15
+
5
16
// Add custom data tracked to turn a syntax tree into markdown.
6
17
declare module 'mdast-util-to-markdown' {
7
18
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ function enterTable(token) {
56
56
} ,
57
57
token
58
58
)
59
- // @ts -expect-error: to do: map.
60
59
this . setData ( 'inTable' , true )
61
60
}
62
61
@@ -66,7 +65,6 @@ function enterTable(token) {
66
65
*/
67
66
function exitTable ( token ) {
68
67
this . exit ( token )
69
- // @ts -expect-error: to do: map.
70
68
this . setData ( 'inTable' )
71
69
}
72
70
@@ -103,7 +101,6 @@ function enterCell(token) {
103
101
function exitCodeText ( token ) {
104
102
let value = this . resume ( )
105
103
106
- // @ts -expect-error: to do: map.
107
104
if ( this . getData ( 'inTable' ) ) {
108
105
value = value . replace ( / \\ ( [ \\ | ] ) / g, replace )
109
106
}
You can’t perform that action at this time.
0 commit comments