gjtorikian / commonmarker

Ruby wrapper for the comrak (CommonMark parser) Rust crate
MIT License
432 stars 84 forks source link

Inconsistency with Comrak on inlines followed by html #306

Closed GabeIsman closed 3 months ago

GabeIsman commented 3 months ago

Here's the test string: _test_<br>test

Comrak: <p><em>test</em><!-- raw HTML omitted -->test</p>
cmark: <p><em>test</em><!-- raw HTML omitted -->test</p>
Commonmarker: <p>_test_<!-- raw HTML omitted -->test</p>

It also happens for strongs that end in a punctuation mark: **test.**<br>test. It doesn't seem to matter what the tag is _test._<div>test.

I'm not familiar with Rust but if you point me in the right direction I might be able to help out.

gjtorikian commented 3 months ago

I can't reproduce this. What version of Commonmarker are you running?

irb(main):001> Commonmarker.to_html("_test_<br>test")
=> "<p><em>test</em><!-- raw HTML omitted -->test</p>\n"
irb(main):002> Commonmarker::VERSION
=> "1.1.4"
GabeIsman commented 3 months ago

Huh I'm on the same:

[94] pry(main)> Commonmarker.to_html("_test_<br>hey")
=> "<p>_test_<!-- raw HTML omitted -->hey</p>\n"
[95] pry(main)> Commonmarker::VERSION
=> "1.1.4"

Ruby 3.2.2

kivikakk commented 3 months ago

I this is fixed in main, more recently than the latest release (which is indeed 1.1.4).

gjtorikian commented 3 months ago

I reached the same conclusion just now! 1.1.5, released via https://github.com/gjtorikian/commonmarker/issues/306, should have the latest and greatest comrak dependencies. I was indeed running my commands in main.

Please reopen if the problem persists!

GabeIsman commented 3 months ago

Great, TY!