1. Oben Sonne
  2. diggie

Commits

Oben Sonne  committed 19fcc2f

Images link to themselves (except parameter 'nolink' is set)

  • Participants
  • Parent commits 78d0377
  • Branches default

Comments (0)

Files changed (1)

File diggie/mdx.py

View file
         el.set("style", style)
         for key, value in [p.split("=", 1) for p in params if "=" in p]:
             el.set(key, value.strip("'\""))
+
+        if "nolink" not in params:
+            atag = markdown.etree.Element('a')
+            atag.set("href", "/media/images/%s" % fname)
+            atag.append(el)
+            el = atag
+
         return el
 
 class DiggieExtension(markdown.Extension):