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
While writing my own plugin mkdocs-pom-parser-plugin I noticed it was specifically not working when it was together with yours. It took me a while to understand the issue, but in essence the code below:
Should be converted to something like this (I haven't tested it in your repo, but works in mine):
defon_page_markdown(self, markdown, config, **kwargs):
# log.debug("pom on_page_markdown[markdown: %s]", markdown)# Do not use Template because it will remove all unknown template variables and break the chain# if there are other plugins hooked to on_page_markdown event.# https://stackoverflow.com/questions/20120957/jinja-leave-template-tags-after-render# md_template = Template(markdown)env=jinja2.Environment(undefined=jinja2.DebugUndefined)
md_template=env.from_string(markdown)
returnmd_template.render(**config.get("extra"))
Since you are using Template, all other plugins which are also hooked to on_page_markdown will receive a sanitized template string which will not contain any of the unknown variables and thus resulting in head scratches and wondering why nothing shows when all tests are actually passing. :)
Hi,
While writing my own plugin mkdocs-pom-parser-plugin I noticed it was specifically not working when it was together with yours. It took me a while to understand the issue, but in essence the code below:
mkdocs-markdownextradata-plugin/markdownextradata/plugin.py
Lines 91 to 95 in 9af2957
Should be converted to something like this (I haven't tested it in your repo, but works in mine):
Since you are using
Template
, all other plugins which are also hooked toon_page_markdown
will receive a sanitized template string which will not contain any of the unknown variables and thus resulting in head scratches and wondering why nothing shows when all tests are actually passing. :)https://stackoverflow.com/questions/20120957/jinja-leave-template-tags-after-render
The text was updated successfully, but these errors were encountered: