You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a link/part title/etc. in SUMMARY.md contains Markdown fancier than plaintext, mdBook strips out all of the formatting and uses just the plaintext as the name of the item:
The <T> is interpreted as raw HTML since it is no longer enclosed in inline code
The chapter title is rendered as "Box" (with no <T>, since that is interpreted as an empty and meaningless HTML tag)
When converting the book to EPUB, which is more strict about closing tags, the <T> being interpreted as HTML instead of inline code breaks rendering altogether
Proposed Solution
I propose that mdBook preserve the original Markdown for links/part titles/etc. in SUMMARY.md.
#1785, which relates to a similar issue, noted this, stating that:
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.
Is this still an issue? It should be possible to use the ranges provided by pulldown_cmark through its offset iterator (which mdBook already uses to parse the summary) to grab the Markdown source from the raw &str of the summary by keeping track of the start of the range when the name begins and the end of the range when the name ends.
Problem
When a link/part title/etc. in SUMMARY.md contains Markdown fancier than plaintext,
mdBook
strips out all of the formatting and uses just the plaintext as the name of the item:mdBook/src/book/summary.rs
Lines 595 to 606 in ec996d3
I'm running into an issue where:
mdBook
("Box<T>" without the backticks), is inserted into another chapterProposed Solution
I propose that
mdBook
preserve the original Markdown for links/part titles/etc. in SUMMARY.md.#1785, which relates to a similar issue, noted this, stating that:
Is this still an issue? It should be possible to use the ranges provided by
pulldown_cmark
through its offset iterator (whichmdBook
already uses to parse the summary) to grab the Markdown source from the raw&str
of the summary by keeping track of the start of the range when the name begins and the end of the range when the name ends.mdBook/src/book/summary.rs
Lines 164 to 165 in ec996d3
Notes
This would have to be a breaking change
The text was updated successfully, but these errors were encountered: