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
Markdown: Breaks italic syntax that contains unescaped underscores #6112
Comments
Remark parser assumes But shouldn't underscores be escaped anyway? For example, escaped It seems it's malformed (unescaped) input, not a prettier's bug. What do you think? |
@revelt Thanks again.. you're right. This isn't a high priority bug since the output is valid, but it's not exactly pretty, so we should probably fix it anyway? |
I just ran into a problem with this using version 2.3.2: Input:
Output:
This rewrite breaks the link and does not render correctly: Expected behavior:
|
Looks like this might be related to prettier/prettier#6112 , but the observed behavior is more broken than that bug indicates.
There's a similar issue without even considering links my_file_name is _italic_ is prettified to my*file_name is \_italic* I tried to circumvent this by escaping the my\_file\_name is _italic_ which gets prettified to my_file_name is _italic_ which in turn gets prttified to my*file_name is \_italic* So it seems that prettifying the file twice (we're using a pre-commit hook with pretty-quick) will break the formatting and the intention even if you escape the please see this playground if required I can make this a separate issue. |
Related: #11828 |
Prettier 1.17.0
Playground link
Input:
Output:
Expected behavior:
(Should not escape the final underscore for
Incorrect Output
.)The text was updated successfully, but these errors were encountered: