Skip to content

Allow html tags in TOC items and in section titles#101

Open
michalfapso wants to merge 1 commit into
domWalters:developfrom
michalfapso:fea_allow_html_tags_in_section_titles
Open

Allow html tags in TOC items and in section titles#101
michalfapso wants to merge 1 commit into
domWalters:developfrom
michalfapso:fea_allow_html_tags_in_section_titles

Conversation

@michalfapso
Copy link
Copy Markdown

In my documentation project I have a "PRO" badge generated by a macro {{ _PRO }} used in nav section titles, adding <img .../> to those titles. But mkdocs-to-html escaped html tags in titles so they were shown as plaintext html. This patch makes them rendered correctly, similarly to the normal mkdocs-material html output.

Here is an example of the image badge in a section title in TOC:
image

@michalfapso michalfapso force-pushed the fea_allow_html_tags_in_section_titles branch 2 times, most recently from 845d51a to eea39e3 Compare October 30, 2025 19:59
@michalfapso michalfapso force-pushed the fea_allow_html_tags_in_section_titles branch from eea39e3 to dfcb54b Compare October 30, 2025 20:13
@domWalters
Copy link
Copy Markdown
Owner

domWalters commented Apr 29, 2026

Hi,

I'm doing some updates to this repo at the moment, after admittedly neglecting it for quite a while.

Can you provide some minimal example so that I can test this?

Just in code blocks as a comment here would be fine.

@domWalters domWalters self-assigned this Apr 29, 2026
@domWalters domWalters added the enhancement New feature or request label Apr 29, 2026
@domWalters domWalters self-requested a review April 29, 2026 09:20
@domWalters domWalters assigned michalfapso and unassigned domWalters Apr 29, 2026
@michalfapso
Copy link
Copy Markdown
Author

Sure, @domWalters, it may take some time till I get to it, but I'll try my best to prepare the minimal example soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants