Closed ptc-tonyo closed 1 year ago
Welcome @ptc-tonyo! 👋 Sorry you ran into some confusion.
A good starting point would be understand what Markdown is and what it supports quick version: https://commonmark.org/help/ more formal details: https://spec.commonmark.org/0.30/#emphasis-and-strong-emphasis
Emphasis is surrounded by a single *
or _
on either side.
Bold text is surrounded by two **
or __
on either side.
There is no underline construct in markdown.
remark/mdast-util-from-markdown will preserve valid and supported markdown structure.
remark/micromark/mdast-util-from-markdown do support extending markdown with new syntax. Creating your own custom markdown-like flavor that is only supported by your application is not generally advisable, but is possible https://github.com/micromark/micromark#extending-markdown
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
Thanks. I think I was looking at a different flavour of markdown when I chose the example.
Initial checklist
Affected packages and versions
mdast-util-to-markdown "^2.0.0" => "remark": "^15.0.1", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0",
Link to runnable example
No response
Steps to reproduce
This unit test fails:
Expected behavior
Both bold and italics are parsed to become
type: 'emphasis'
in the AST so can't be unparsed via remark-stringify as it can't distinguish them and underlined becomes**underlined text**
.Actual behavior
I expected
remarkParse
to be reversable byremarkStringify
however we get his result:I'm testing using vitest
Affected runtime and version
node@18.18.0
Affected package manager and version
yarn@122.19
Affected OS and version
Windows 10
Build and bundle tools
Vite