chiark / gitweb /
m.math: apply https://github.com/tuxu/latex2svg/pull/1.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 14 Sep 2017 22:03:02 +0000 (00:03 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 14 Sep 2017 22:11:11 +0000 (00:11 +0200)
Fixes crashes in some corner cases.

pelican-plugins/m/latex2svg.py

index 92e223bcfdc33e87bbac4b71b3474c12924d4ffc..f068f47e3f9ffdf3a854277da93d751bf1b57d74 100644 (file)
@@ -131,7 +131,7 @@ def latex2svg(code, params=default_params, working_directory=None):
             return None, None
 
     def get_measure(output, name):
-        regex = r'\b%s=([0-9.]+)pt' % name
+        regex = r'\b%s=([0-9.e-]+)pt' % name
         match = re.search(regex, output)
         if match:
             return float(match.group(1)) / fontsize