-
Notifications
You must be signed in to change notification settings - Fork 862
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
The title from toc_tokens
ignores the smarty
extension
#1438
Comments
By the way, please don't solve this by lowering the priority of the |
I didn't have much involvement in the smarty extension, which was added much later than TOC. I wonder why it was given a lower priority. @mitya57 do you recall? I seem to recall you being involved in the development of the smarty extension. I ask why because, barring any good reason not to, I have no object in raising the priority to be before TOC. |
And add a test for using smarty in ToC headers. Fixes Python-Markdown#1438.
And add a test for using smarty in ToC headers. Fixes Python-Markdown#1438.
And add a test for using smarty in ToC headers. Fixes #1438.
Current actual result:
Expected result:
Background where I discovered this: mkdocs/mkdocs#3357 (comment)
This happens because
smarty
runs at a lower priority thantoc
(unlike most other treeprocessors) and it doesn't have a chance to kick in.markdown/markdown/extensions/toc.py
Line 404 in a63e6f3
markdown/markdown/extensions/smarty.py
Line 272 in a63e6f3
This other extension is presumably affected in the same way, probably among others:
https://github.com/facelessuser/pymdown-extensions/blob/8f5283f71e8833f1ba0fa0bbe2680e1ad2c6cb19/pymdownx/smartsymbols.py#L167
Something should be done so that all the rest of the treeprocessors are also applied before saving the title. Maybe postprocessors too, rather than applying the unescape functionality out-of-band.
The text was updated successfully, but these errors were encountered: