gjtorikian / commonmarker

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

Expose code and code blocks' literals via string_content/=. #290

Closed kivikakk closed 1 month ago

kivikakk commented 1 month ago

Hiya! What do you think of this? Currently the literal members of Code and CodeBlock nodes isn't exposed anywhere.

The discrepancy between these and text()-fetchable things is a bit unfortunate on the Comrak side, but it's a side-effect of its legacy (i.e. the implication that text() means "get me the content of a Text node, and fail if it isn't one") — I see no reason to do the same to string_content just because of what it's backed by currently.

Fixes #289.

gjtorikian commented 1 month ago

Thank you!

rossta commented 1 month ago

Thank you @kivikakk and @gjtorikian!