aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown.py')
-rwxr-xr-xmarkdown.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/markdown.py b/markdown.py
index 38923ac..af611c8 100755
--- a/markdown.py
+++ b/markdown.py
@@ -2129,18 +2129,20 @@ def load_extension(ext_name, configs = []):
pairs = [x.split("=") for x in ext_args.split(",")]
configs.update([(x.strip(), y.strip()) for (x, y) in pairs])
- extension_module_name = "mdx_" + ext_name
+ ext_module = 'markdown_extensions'
+ module_name = '.'.join([ext_module, ext_name])
+ extension_module_name = '_'.join(['mdx', ext_name])
try:
- module = __import__(extension_module_name)
-
+ module = __import__(module_name, {}, {}, [ext_module])
except ImportError:
try:
- module = __import__('.'.join(['mdx', extension_module_name]), {}, {}, ['mdx'])
+ module = __import__(extension_module_name)
except:
message(WARN,
- "Couldn't load extension '%s' from \"%s\" - continuing without."
- % (ext_name, extension_module_name) )
+ "Failed loading extension '%s' from '%s' or '%s' "
+ "- continuing without."
+ % (ext_name, module_name, extension_module_name) )
# Return a dummy (do nothing) Extension as silent failure
return Extension(configs={})