Repository navigation
Replies: 2 comments 2 replies
|
You can make the replacement directly within the def on_page_markdown(self, markdown, page: Page, config, files):
markdown = markdown.replace("[[_TOC_]]", "") |
|
Hi @jaywhj following up on the [[ TOC ]] question: moving the replacement into an on_files hook (setting the file content there) fixed it, thanks. One related issue with the recently-updated cards: summaries can contain raw Markdown, and in one case the card HTML actually breaks. Minimal repro (document-dates 3.8.7, mkdocs-materialx 10.2.0). A page starting with: # Title
Reference style [ref link][r1] here.
[r1]: https://example.com/ref
Autolink <https://example.com/auto> here.produces this card summary (in config.extra.recently_updated_docs): Two problems:
<div class="card-summary">Autolink <https: example.com="" auto=""> here. Rest of summary...</https:></div>The browser parses https://... as an unknown element and renders everything after it inside that element, so the tail of the summary gets swallowed/mangled. Suggested fixes (small, I think):
Happy to send a PR for the escaping fix if that's the direction you'd like. Otherwise we'll work around it on our side in the meantime. |
Uh oh!
There was an error while loading. Please reload this page.
Our issue is that we use GitLab and publish to GitLab pages. Before we do, we run a custom python hook
This removes that string from the finalized docs. However, it looks like the recent updates module runs, it does so with the "[[TOC]]" content still in there so our recent updates look like..
...which also seems to want to include the raw markdown for links.
I assume there's no way to have this module run on the resultant HTML instead of the raw input markdown?
All reactions