Add utils::character_reference
#981
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am a consumer of this crate, but I’m not outputting HTML, and I would like to transform
InlineHtml
andHtmlBlock
nodes according to my own needs. Writing a small HTML parser myself is easy enough, butpulldown-cmark
already has the large table required to resolved named HTML entities, and for binary size’s sake I’d prefer to avoid duplicating all of this in my own code.Therefore, this feature request exposes the functionality of resolving HTML character references in the public API of the crate, via the
utils
module.While it may be nice to expose more HTML parsing, such an API would be more subjective and would be hard to make fit everybody’s needs. By contrast, this function is minimal and self-contained, and has legitimate disadvantages to users rolling their own versions of.