Skip to content

Commit db2ab34

Browse files
committed
fix: Instantiate config of the autorefs plugin when it is not enabled by the user
Issue-autorefs#57: mkdocstrings/autorefs#57
1 parent a65035a commit db2ab34

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/mkdocstrings/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from mkdocs.config import config_options as opt
2727
from mkdocs.plugins import BasePlugin
2828
from mkdocs.utils import write_file
29-
from mkdocs_autorefs.plugin import AutorefsPlugin
29+
from mkdocs_autorefs.plugin import AutorefsConfig, AutorefsPlugin
3030

3131
from mkdocstrings._cache import download_and_cache_url, download_url_with_gz
3232
from mkdocstrings.extension import MkdocstringsExtension
@@ -181,6 +181,7 @@ def on_config(self, config: MkDocsConfig) -> MkDocsConfig | None:
181181
except KeyError:
182182
# Otherwise, add a limited instance of it that acts only on what's added through `register_anchor`.
183183
autorefs = AutorefsPlugin()
184+
autorefs.config = AutorefsConfig()
184185
autorefs.scan_toc = False
185186
config.plugins["autorefs"] = autorefs
186187
log.debug(f"Added a subdued autorefs instance {autorefs!r}")

0 commit comments

Comments
 (0)