Skip to content
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

Italics with underscores (e.g. _a_) don't render correctly with short strings (1 and 2 chars) #1188

Closed
kaelig opened this issue Mar 30, 2018 · 1 comment

Comments

@kaelig
Copy link

kaelig commented Mar 30, 2018

Note: could be a duplicate of #1178 (the following issue may be more detailed though)

Marked version: 0.3.19

Markdown flavor: not sure

What pain point are you perceiving?

Short strings in italics don't render properly:

_a_

_ab_

See https://marked.js.org/demo/?text=Short%20strings%20in%20italics%20don%27t%20render%0A%0A_a_%0A%0A_ab_%0A%0AAll%20of%20these%20do%20render%20properly%3A%0A%0A*%20_abc_%0A*%20*a*%0A*%20*ab*%0A*%20*abc*%0A*%20__a__%0A*%20__ab__%0A*%20__abc__%0A*%20**a**%0A*%20**ab**%0A*%20**abc**%0A

What solution are you suggesting?

n/a

Expectation

<p><em>a</em></p>
<p><em>ab</em></p>

Result

<p>_a_</p>
<p>_ab_</p>

What was attempted

The workaround is to use * instead of _ to wrap italics. Unfortunately, formatters like Prettier enforces _ so you end up with having to do this (works in Prettier 1.12+):

<!-- prettier-ignore-start -->

_a_

_ab_

<!-- prettier-ignore-end -->

Or this if you're using prettier < 1.12

<i>a<i>

<i>ab</i>
@UziTech
Copy link
Member

UziTech commented Mar 30, 2018

duplicate of #1178

should be fixed by #1181

@UziTech UziTech closed this as completed Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants