-
-
Notifications
You must be signed in to change notification settings - Fork 123
If two different handlers are used in one document, the jinja env is not updated #502
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Found another issue/question with what I was trying to do with a custom handler.
If one document has two identifiers that use different handlers; only the first one's env is updated. My templates error out because the default mkdocstring filters are missing (highlight, heading or convert_markdown) don't exist in the second handler yet and instead I only have the built-in jinja filters and the any filter that is added when the env is initialized.
::: mkdocstrings_handlers.custom_handler.other_module.AccessTypes
handler: python
::: demo.custom_identifier.stuff
handler: custom_handlerIt looks like these few lines are the offenders and I'm curious if there is a drawback to updating it every time, updating the env on init or make the _updated_env a part of the handler and not the extension? Commenting out self._updated_env = True is enough to resolve this issue.
if not self._updated_env:
log.debug("Updating renderer's env")
handler._update_env(self.md, self._config) # noqa: WPS437 (protected member OK)
self._updated_env = TrueReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working