-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected escaping of characters since 2.1.1 #65
Comments
Hi! You note that a change happened in a version. Did you see the release notes / commits that were made? The changes are intentional. There are commits, there is talk, there are tests. Do you have arguments? |
This comment has been minimized.
This comment has been minimized.
I looked at the changelog but afaiu, the fix should only affect "invalid" mdast trees that would produce whitespace inside formats (eg
or
first**secondimportant** (well, the case above has problems with the **`, but this is another issue) |
This comment has been minimized.
This comment has been minimized.
This also indeed touches on “invalidness”. Although it isn’t that: all of this is valid. Asterisks are different than underscores in markdown. There rules are simpler. They can form emphasis/strong more often, because they are less often used in natural language. Underscores, in words, as you perhaps know, cannot form emphasis. That is why this escape happens here. That I can recommend two things: Either is fine? |
I will add that it is very hard to get emphasis/strong right for |
ok. thanks for the explanation. probably a good thing to switch to |
Initial checklist
Affected packages and versions
mdast-util-to-markdown@2.1.1
Link to runnable example
No response
Steps to reproduce
the changes in
mdast-util-to-markdown@2.1.1
cause unexpected escaping of normal characters, for example:generates:
it used to generate:
another example:
generates:
before:
Expected behavior
it should not escape characters that are not needed to be escaped.
Actual behavior
it escapes unexpected characters.
Affected runtime and version
node v20.18.0
Affected package manager and version
No response
Affected OS and version
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: