Closed as not planned
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
mdast-util-to-markdown
Link to runnable example
No response
Steps to reproduce
import {fromMarkdown} from 'mdast-util-from-markdown'
import {toMarkdown} from 'mdast-util-to-markdown'
import {toHast} from 'mdast-util-to-hast'
import {toHtml} from 'hast-util-to-html'
const md = `foo***bar***buz`;
console.log(md) // original
console.log(toMarkdown(fromMarkdown(md))) // round trip
console.log(toHtml(toHast(fromMarkdown(md)))) // HTML
Expected behavior
until mdast-util-to-markdown version 2.1.0, or commit df0d6a6, it works correctly.
toMarkdown(fromMarkdown(md))
runs the round trip from Markdown to Markdown.
foo***bar***buz
foo***bar***buz
<p>foo<em><strong>bar</strong></em>buz</p>
Actual behavior
since mdast-util-to-markdown version 2.1.1, or commit 97fb818, it made characters escaped needlessly just before and after both *
and **
.
toMarkdown(fromMarkdown(md))
cannot run the round trip from Markdown to Markdown.
toHtml(toHast(fromMarkdown(md)))
still has no trouble on the other hand.
foo***bar***buz
foo***bar***buz
<p>foo<em><strong>bar</strong></em>buz</p>
It means version 2.1.1 has a breaking change. Version 2.1.2 has the same issue.
Thank you maintaining this anyway.
Affected runtime and version
node@22.11.0
Affected package manager and version
No response
Affected OS and version
No response
Build and bundle tools
No response