Skip to content

Commit

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

Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
shlroland authored Jul 5, 2024
1 parent 3f53f29 commit 9c480aa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dev/lib/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

const tasklistCheck = {tokenize: tokenizeTasklistCheck}
const tasklistCheck = {name: 'tasklistCheck', tokenize: tokenizeTasklistCheck}

/**
* Create an HTML extension for `micromark` to support GFM task list items
Expand Down
13 changes: 13 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ test('markdown -> html (micromark)', async function (t) {
)
})

await t.test(
'should skip tasklistCheck construct if `disable.null` includes `tasklistCheck`',
async function () {
assert.deepEqual(
micromark('* [ ] foo', {
extensions: [gfmTaskListItem(), {disable: {null: ['tasklistCheck']}}],
htmlExtensions: [gfmTaskListItemHtml()]
}),
'<ul>\n<li>[ ] foo</li>\n</ul>'
)
}
)

await t.test('should not support laziness (1)', async function () {
assert.deepEqual(
micromark('*\n [x]', {
Expand Down

0 comments on commit 9c480aa

Please sign in to comment.