developit / snarkdown

:smirk_cat: A snarky 1kb Markdown parser written in JavaScript
http://jsfiddle.net/developit/828w6t1x/
MIT License
2.28k stars 110 forks source link

Unexpected parsing with single characters such as * #94

Open benskz opened 3 years ago

benskz commented 3 years ago

I'm trying to use an asterisk in my string but it makes everything after is Italic. I believe this behaviour is unexpectes.

Input:

This string has something *important, so I use an asterisk.

Expected: This string has something *important, so I use an asterisk.

Actual: This string has something *important, so I use an asterisk.

If this behaviour is expected I then one should resort to escaping the said character, however this also produces an undesirable result.

Input:

This string has something \*important, so I use an asterisk.

Expected: This string has something *important, so I use an asterisk.

Actual: This string has something \*important, so I use an asterisk.

axelpale commented 3 years ago

This is f*king important issue ;) In our case, users might not even realise they are writing markdown. Therefore it is common to see a single asterisk to be used for something else than emphasis, for example ad hoc foot notes, curse words or wild card characters.