Don't try to render summary links as markdown. #1785
Merged
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.
Links in SUMMARY.md can have trouble rendering correctly if they include any sort of markdown elements. A particular example this tries to fix is escaping of asterisks like
[\*foo\*]
. Previously, the summary parser would strip out all the markdown formatting, and then the TOC renderer would then try to re-render the now stripped chapter name. With escaped asterisks, the escaping is removed, leaving italics to be rendered.It looks like long ago it was intended this was to handle
code
blocks in summary names. However, that hasn't worked for a long time.There was some discussion in #70 about how this should work, and whether or not code blocks should be rendered. Properly rendering the link name with things like
code
blocks is a difficult problem, so I'm punting on that for now. The only safe thing to do would be to grab the raw text from the original markdown, which is awkward to do with pulldown_cmark.This also fixes the create_missing pages to escape the title properly if the chapter name has angled brackets.