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

Add checks to ensure in-word formatting chars aren't replaced #101

Open jacobmischka opened 3 years ago

jacobmischka commented 3 years ago

Basic text formatting sequences (_, *, __, **) are now required to not be entirely within a word; that is, they must have a non-word character on either side to be replaced.

This prevents words that include those characters (snake_case words, or some proper nouns that may include an Embedded*Asterisk__Or**Two for some reason) from being captured.

Fixes #21

yanndinendal commented 1 year ago

Yes it's expected in most markdown formatters that one single underscore inside a word should not be interpreted as the start of an italic sentence with no end.

Could this PR be taken into consideration?