Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to render summary links as markdown. #1785

Merged
merged 1 commit into from
Apr 15, 2022

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Apr 15, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant