Prettier 1.19.1
Playground link
Input:
aa_bb `aa_bb`
aa_bb `aa _bb`
aa_bb `aa_ bb`
aa_bb `aa_`
Renders correctly:
aa_bb aa_bb
aa_bb aa _bb
aa_bb aa_ bb
aa_bb aa_
Output:
aa_bb `aa_bb`
aa_bb `aa _bb`
aa*bb `aa* bb`
aa*bb `aa*`
Renders incorrectly:
aa_bb aa_bb
aa_bb aa _bb
aa*bb aa* bb
aa*bb aa*
Expected behavior:
Code should be unchanged, asterisks should not replace underscores in prose. Underscores should not be matched to content inside an inline code block. Original input renders correctly on the commonmark dingus
This seems to have something to do with tokens inside the inline code block ending with an underscore.
Workaround
Adding a backslash to the initial underscore prevents the content from changing.
aa\_bb `aa_ bb`
aa\_bb `aa_`
Renders correctly:
aa_bb aa_ bb
aa_bb aa_
Prettier 1.19.1
Playground link
Input:
Renders correctly:
aa_bb
aa_bbaa_bb
aa _bbaa_bb
aa_ bbaa_bb
aa_Output:
Renders incorrectly:
aa_bb
aa_bbaa_bb
aa _bbaa*bb
aa* bbaa*bb
aa*Expected behavior:
Code should be unchanged, asterisks should not replace underscores in prose. Underscores should not be matched to content inside an inline code block. Original input renders correctly on the commonmark dingus
This seems to have something to do with tokens inside the inline code block ending with an underscore.
Workaround
Adding a backslash to the initial underscore prevents the content from changing.
Renders correctly:
aa_bb
aa_ bbaa_bb
aa_