Code element generated instead of strikethrough
RichardFevrier opened this issue · 4 comments
RichardFevrier commented
Consider the following markdown:
"~~~~"
And the following code/configuration:
"mdast-util-from-markdown": "0.8.1", (latest)
"micromark-extension-gfm-strikethrough": "0.6.2", (latest)
"mdast-util-gfm-strikethrough": "0.2.2", (latest)
"micromark-extension-gfm-task-list-item": "0.3.2", (latest)
"mdast-util-gfm-task-list-item": "0.1.5", (latest)
var md2mdast = require('mdast-util-from-markdown');
var strikethroughSyntax = require('micromark-extension-gfm-strikethrough')
var strikethrough = require('mdast-util-gfm-strikethrough');
var tasklistitemSyntax = require('micromark-extension-gfm-task-list-item');
var tasklistitem = require('mdast-util-gfm-task-list-item');
const mdtree = md2mdast("~~~~", {
extensions: [strikethroughSyntax(), tasklistitemSyntax],
mdastExtensions: [strikethrough.fromMarkdown, tasklistitem.fromMarkdown]
});
Here is the result of mdtree:
{
"type":"root",
"children":[
{
"type":"code",
"lang":null,
"meta":null,
"value":"",
"position":{
"start":{
"line":1,
"column":1,
"offset":0
},
"end":{
"line":1,
"column":5,
"offset":4
}
}
}
],
"position":{
"start":{
"line":1,
"column":1,
"offset":0
},
"end":{
"line":1,
"column":5,
"offset":4
}
}
}
Problem:
The empty strikethrough text is generated into a code element
wooorm commented
That’s expected: https://spec.commonmark.org/dingus/?text=~~~~
RichardFevrier commented
Effectively I'm sorry I didn't know that one.
wooorm commented
hah, no problem.
But: checking first with CommonMark (the dingus) and GitHub (a private gist) would be appreciated in the future ;)
RichardFevrier commented
Totally 🙏