File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 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'
22
33export { gfmTableFromMarkdown , gfmTableToMarkdown } from './lib/index.js'
44
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+
516// Add custom data tracked to turn a syntax tree into markdown.
617declare module 'mdast-util-to-markdown' {
718 // 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) {
5656 } ,
5757 token
5858 )
59- // @ts -expect-error: to do: map.
6059 this . setData ( 'inTable' , true )
6160}
6261
@@ -66,7 +65,6 @@ function enterTable(token) {
6665 */
6766function exitTable ( token ) {
6867 this . exit ( token )
69- // @ts -expect-error: to do: map.
7068 this . setData ( 'inTable' )
7169}
7270
@@ -103,7 +101,6 @@ function enterCell(token) {
103101function exitCodeText ( token ) {
104102 let value = this . resume ( )
105103
106- // @ts -expect-error: to do: map.
107104 if ( this . getData ( 'inTable' ) ) {
108105 value = value . replace ( / \\ ( [ \\ | ] ) / g, replace )
109106 }
You can’t perform that action at this time.
0 commit comments