Commits

dan mackinlay  committed 6925d39

intermediate commit - what is going on with external image URLs and patching action?

  • Participants
  • Parent commits 99ca1e3

Comments (0)

Files changed (2)

File tinkerer/ext/patch.py

     XML as string.
     '''
     in_str = convert(body).encode("utf-8")
-    doc = xml.dom.minidom.parseString(in_str)
+    try:
+        doc = xml.dom.minidom.parseString(in_str)
+    except Exception, e:
+        import pdb; pdb.set_trace()
+        doc = xml.dom.minidom.parseString(in_str)
     patch_node(doc, docpath)
 
     body = doc.toxml()

File tinkertest/test_patch.py

                     # external target
                     ".. image:: ../../../img3.png\n"
                     "   :target: http://www.archlinux.org\n"
+                    "\n"
+                    # external target, external image
+                     ".. image::  http://www.archlinux.org\n"
+                     "   :target: http://www.archlinux.org/static/archnavbar/archlogo.png\n"
             )
         ]
 
                 'href="../../../_images/img1.png"',
                 'href="/_images/img2.png"',
                 'href="http://www.archlinux.org"',
+                'href="http://www.archlinux.org"'
              ]),
             (["index.html"],
              [
                 # absolute and external targets should be unchanged
                 'href="/_images/img2.png"',
                 'href="http://www.archlinux.org"',
+                'href="http://www.archlinux.org"',
              ]),
             (["rss.html"],
              [
                 # absolute target doesn't get patched
                 # 'href="http://127.0.0.1/_images/img2.png"',
                 'href="http://www.archlinux.org"',
+                'href="http://www.archlinux.org"'
              ])
         ]