Process Unicode scalar values over 255 to HTML entities #32
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.
Characters which are not in the single byte Unicode range are not rendered properly in the output generated by Ink. Characters like em dash (used in the Ink
README.md
file) are passed through unchanged to the output HTML. There may be browser settings to cope with such extended graphemes but Safari, by default, does not.This code intercepts such characters and converts them to HTML entities so an em dash, for example, is converted to
—
. I'm far from certain that I put that intercept in an optimal place, and is a pretty brute-force approach, but I'm sure discussion here will improve that.Note the correct rendering of a line from the Ink README: