mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-04-12 07:06:28 +07:00
Allow third-party plugins to override core plugins (#2591)
* Allow third-party plugins to override core plugins * Improve resilience of check for core plugin
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user