Skip to content

Commit

Permalink
Allow third-party plugins to override core plugins (mkdocs#2591)
Browse files Browse the repository at this point in the history
* Allow third-party plugins to override core plugins

* Improve resilience of check for core plugin
  • Loading branch information
squidfunk authored and ultrabug committed Oct 8, 2021
1 parent cff0db7 commit 2441d3b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mkdocs/plugins.py
Expand Up @@ -26,7 +26,15 @@ def get_plugins():

plugins = importlib_metadata.entry_points(group='mkdocs.plugins')

return {plugin.name: plugin for plugin in plugins}
# Allow third-party plugins to override core plugins
pluginmap = {}
for plugin in plugins:
if plugin.name in pluginmap and plugin.value.startswith("mkdocs.contrib."):
continue

pluginmap[plugin.name] = plugin

return pluginmap


class BasePlugin:
Expand Down

0 comments on commit 2441d3b

Please sign in to comment.