Skip to content

Commit

Permalink
Add name
Browse files Browse the repository at this point in the history
Closes GH-13.

Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
shlroland authored Jul 5, 2024
1 parent f5e8ac1 commit da4900e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dev/lib/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ import {gfmTableAlign} from './infer.js'
*/
export function gfmTable() {
return {
flow: {null: {tokenize: tokenizeTable, resolveAll: resolveTable}}
flow: {
null: {name: 'table', tokenize: tokenizeTable, resolveAll: resolveTable}
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ test('markdown -> html (micromark)', async function (t) {
}
)

await t.test(
'should skip table construct if `disable.null` includes `table`',
async function () {
assert.deepEqual(
micromark(`123\n\n| a | b | c |\n| - | - | - |\n| d | e | f |`, {
extensions: [gfmTable(), {disable: {null: ['table']}}],
htmlExtensions: [gfmTableHtml()]
}),
'<p>123</p>\n<p>| a | b | c |\n| - | - | - |\n| d | e | f |</p>'
)
}
)

await t.test(
'should not support a table w/ the head row ending in an eof (2)',
async function () {
Expand Down

0 comments on commit da4900e

Please sign in to comment.