From efe6021e4454d24f8a79fd7e8a01f6da99576924 Mon Sep 17 00:00:00 2001 From: Hao Chi Kiang Date: Sat, 21 Aug 2021 23:17:46 +0200 Subject: [PATCH] Compatibility with some versions of dvisvgm In dvisvgm 2.11.1, at least on my machine, the xml namespace is in http:// instead of https:// --- readme2tex/render.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme2tex/render.py b/readme2tex/render.py index 4055b21..e8486d9 100644 --- a/readme2tex/render.py +++ b/readme2tex/render.py @@ -177,9 +177,13 @@ def render( xml = (ET.fromstring(svg)) attributes = xml.attrib gfill = xml.find('{https://www.w3.org/2000/svg}g') + if gfill is None: + gfill = xml.find('{http://www.w3.org/2000/svg}g') gfill.set('fill-opacity', '0.9') if not block: uses = gfill.findall('{https://www.w3.org/2000/svg}use') + if uses is None: + uses = gfill.findall('{http://www.w3.org/2000/svg}use') use = uses[0] # compute baseline off of this dummy element x = use.attrib['x']