yogthos / markdown-clj

Markdown parser in Clojure
Eclipse Public License 1.0
540 stars 120 forks source link

Bad italics with underscores within word #180

Open eerohele opened 2 years ago

eerohele commented 2 years ago

Repro:

(markdown.core/md-to-html-string "foo_bar_baz")
;;=> "<p>foo<i>bar</i>baz</p>"

Expected:

(markdown.core/md-to-html-string "foo_bar_baz")
;;=> "<p>foo_bar_baz</p>"

For reference, see this commonmark.js dingus.

yogthos commented 2 years ago

I'd be open to making a change to check for space before and after, as a workaround you can escape the italics with \_ at the moment.