gjtorikian / commonmarker

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

fix front_matter_delimiter type #257

Closed noraj closed 8 months ago

noraj commented 9 months ago

fix #256

With the fix, restores expected behavior

require 'commonmarker'

Commonmarker.to_html("---\nyaml: true\nage: 42\n---\n# Title 1", options: { extension: { front_matter_delimiter: '---' } } )
# => "<h1>Title 1</h1>\n"

Note, the extension is still stripping anchors tho.

Commonmarker.to_html("---\nyaml: true\nage: 42\n---\n# Title 1" )
# => "<hr />\n<h2><a href=\"#yaml-true-age-42\" aria-hidden=\"true\" class=\"anchor\" id=\"yaml-true-age-42\"></a>yaml: true<br />\nage: 42</h2>\n<h1><a href=\"#title-1\" aria-hidden=\"true\" class=\"anchor\" id=\"title-1\"></a>Title 1</h1>\n"
gjtorikian commented 9 months ago

Nice find, thank you! There are a couple of dependency updates I need to make, but when I do, I will release a version with this fix included.

gjtorikian commented 9 months ago

Ah, unfortunately another frontmatter test failed, and this might require a deeper look into the Rust side of things. Would you be able to do that?

noraj commented 9 months ago

For the Rust side, I fear not.

gjtorikian commented 9 months ago

Got you. I'll try to take a look over the next few days.

gjtorikian commented 8 months ago

Thanks for your patience and contribution. This will go out as 1.0.0.pre11.