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
I have been really looking forward to using the typeset plugin with my documentation as many of my headers are referring to code or objects. Showing them in the TOC as <code> makes it much easier to read.
Bug description
When enabling macros and typeset the TOC seems to not correctly align, specifically when the header is set to be bold and the macros replacement text is a URL.
While putting together this description I started deleting items like extensions etc. in my mkdocs.yml file. I saw various changes in the rendering of what I outlined below. My 'issue' went away when I removed the toc_depth option from the toc extension. I am not sure if that is a bug with the TOC extension or with the way macros/URLs are being handled. Could use some direction on that and since I am not sure I left my bug report as is.
In my .md file I have the following:
### {{rq_host}}
The host object that is not bold.
### **{{rq_host}}**
The host object that is bold...
### **{{rq_test}}**
This is a test of the macros with a non-link/url feature
If I only include the ### {{rq_host}} which is a URL but not bold then everything is displayed without issue:
If we only include ### **{{rq_test}}** which is just plain text and bold then everything is displayed without issue:
Only when we use the combination of a link and the bold do we see an issue with the TOC alignment ### **{{rq_host}}**:
Note: it looks like the whole page is also bold (in previous examples it was not).
For reference, contents of the external yaml file used by macros:
I tried reducing down the number of features in my mkdocs.yml and after deleting all of the content and navigation features I got the below which is what I am seeing in my other documentation (it was at this moment that I started playing around with the extensions and added the second paragraph at the top):
Fixed in 2a1023da4. Thanks again for the excellent reproduction. There were two problems:
The regular expression to find the permalink at the end of the headline was too greedy. If an author provided a custom link as part of the headline, the opening tag of that link was matched with the closing tag of the permalink. Thus all content from the opening link was lost, leaving only the <strong> opening tag, which explains the bold text.
Author-provided anchor links were not removed at all. This is now fixed by inverting order and not limiting anchor link removal to the link at the start. This problem was also fixed in the commit.
Context
I have been really looking forward to using the
typeset
plugin with my documentation as many of my headers are referring to code or objects. Showing them in the TOC as<code>
makes it much easier to read.Bug description
When enabling macros and typeset the TOC seems to not correctly align, specifically when the header is set to be bold and the macros replacement text is a URL.
While putting together this description I started deleting items like extensions etc. in my
mkdocs.yml
file. I saw various changes in the rendering of what I outlined below. My 'issue' went away when I removed thetoc_depth
option from thetoc
extension. I am not sure if that is a bug with the TOC extension or with the way macros/URLs are being handled. Could use some direction on that and since I am not sure I left my bug report as is.In my
.md
file I have the following:If I only include the
### {{rq_host}}
which is a URL but not bold then everything is displayed without issue:If we only include
### **{{rq_test}}**
which is just plain text and bold then everything is displayed without issue:Only when we use the combination of a link and the bold do we see an issue with the TOC alignment
### **{{rq_host}}**
:Note: it looks like the whole page is also bold (in previous examples it was not).
For reference, contents of the external yaml file used by macros:
I tried reducing down the number of features in my
mkdocs.yml
and after deleting all of the content and navigation features I got the below which is what I am seeing in my other documentation (it was at this moment that I started playing around with the extensions and added the second paragraph at the top):Related links
Reproduction
example.zip
The example.zip didn't include the external macros folder so I unzipped it, added it and then re-zipped the files.
Steps to reproduce
Browser
Other
Before submitting
The text was updated successfully, but these errors were encountered: