Initial checklist
Affected package
mdast-util-gfm 3.1.0, mdast-util-to-markdown 2.1.2, mdast-util-from-markdown 2.0.3
Steps to reproduce
Input (9 bytes):
tree₁ has delete > [text, delete > text, text]:
{
"type": "delete",
"children": [
{ "type": "text", "value": "a" },
{ "type": "delete", "children": [{ "type": "text", "value": "a" }] },
{ "type": "text", "value": "a" }
]
}
stringify:
tree₂ flattens to three siblings:
{
"type": "paragraph",
"children": [
{ "type": "delete", "children": [{ "type": "text", "value": "a" }] },
{ "type": "text", "value": "a" },
{ "type": "delete", "children": [{ "type": "text", "value": "a" }] }
]
}
import {fromMarkdown} from 'mdast-util-from-markdown'
import {toMarkdown} from 'mdast-util-to-markdown'
import {gfm} from 'micromark-extension-gfm'
import {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'
const opts = {extensions: [gfm()], mdastExtensions: [gfmFromMarkdown()]}
const tree1 = fromMarkdown('~~a~a~a~~', opts)
const text2 = toMarkdown(tree1, {extensions: [gfmToMarkdown()]})
const tree2 = fromMarkdown(text2, opts)
Actual behavior
Adjacent ~~ closing + ~~ opening delimiters parse as sibling strikethrough spans instead of nested ones. Analogous to the nested-emphasis issue but for GFM strikethrough.
Expected behavior
Nested delete with text siblings preserves nesting across round-trip, same as the equivalent emphasis cases should.
Runtime
node v24.13.1
Package manager
No response
Operating system
Ubuntu (WSL2)
Build and bundle tools
No response
Initial checklist
Affected package
mdast-util-gfm 3.1.0, mdast-util-to-markdown 2.1.2, mdast-util-from-markdown 2.0.3
Steps to reproduce
Input (9 bytes):
tree₁ has
delete > [text, delete > text, text]:{ "type": "delete", "children": [ { "type": "text", "value": "a" }, { "type": "delete", "children": [{ "type": "text", "value": "a" }] }, { "type": "text", "value": "a" } ] }stringify:
tree₂ flattens to three siblings:
{ "type": "paragraph", "children": [ { "type": "delete", "children": [{ "type": "text", "value": "a" }] }, { "type": "text", "value": "a" }, { "type": "delete", "children": [{ "type": "text", "value": "a" }] } ] }Actual behavior
Adjacent
~~closing +~~opening delimiters parse as sibling strikethrough spans instead of nested ones. Analogous to the nested-emphasis issue but for GFM strikethrough.Expected behavior
Nested
deletewith text siblings preserves nesting across round-trip, same as the equivalent emphasis cases should.Runtime
node v24.13.1
Package manager
No response
Operating system
Ubuntu (WSL2)
Build and bundle tools
No response