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.
Till now, named entities like
could not be used in tables inside figures. We've had to manually change them to numeric, XML-valid alternatives. This is because our process couldn't re-encode these named entities as numeric ones, since kramdown doesn't 'reach' inside HTML islands. And we need these entities to be valid in XML for epub output, and for processing tools like Cheerio not to break entities in PDF and EPUB output.So this PR adds a step to our output process that replaces named entities with numeric entities after Jekyll runs, before other processing.
We act on the HTML as a string, and do not try to parse it, because tools that parse the HTML into an AST like parse5, jsdom, or htmlparser2 break XML validity and double-encode entities when they render the HTML back to us.
This processing is not necessary for web and app outputs.
This is currently being tested in a book project at EBW, and should only be merged once it's been field tested in that project.