Skip to content

Commit 7797a32

Browse files
authored
Merge pull request #26 from scranen/main
Fix check for superfences config when loaded via pymdownx.extra
2 parents aa7a774 + 1532878 commit 7797a32

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mkdocs_charts_plugin/plugin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ def on_config(self, config, **kwargs):
5959
config["extra_javascript"] = ["js/mkdocs-charts-plugin.js"] + config["extra_javascript"]
6060

6161
# Make sure custom fences are configured.
62-
custom_fences = config.get("mdx_configs", {}).get("pymdownx.superfences", {}).get("custom_fences", {})
62+
parent_config = config.get("mdx_configs", {})
63+
if "pymdownx.superfences" not in parent_config:
64+
# If "superfences" was loaded through the "extra" plugin,
65+
# then its config will be in a different place
66+
parent_config = parent_config.get("pymdownx.extra", {})
67+
custom_fences = parent_config.get("pymdownx.superfences", {}).get("custom_fences", {})
6368
if not custom_fences:
6469
raise PluginError(
6570
"[mkdocs_charts_plugin]: You have not configured any custom fences, please see the setup instructions."

0 commit comments

Comments
 (0)