From 8f6dcab5f53e6636ba1bca0a4493ad28f461b756 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 14 Jul 2019 22:39:52 +0200 Subject: [PATCH] m.qr: patch the output to be consistent between Travis any my Python 3.7. --- plugins/m/qr.py | 4 ++++ plugins/m/test/qr/page-py36.html | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/m/qr.py b/plugins/m/qr.py index 179b07f8..909a4055 100644 --- a/plugins/m/qr.py +++ b/plugins/m/qr.py @@ -74,6 +74,10 @@ class Qr(rst.Directive): '{:.2f}rem'.format(float(match.group('width'))*9.6/2.54/16.0, 2), viewBox=match.group('viewBox')) svg = _svg_preamble_src.sub(preamble_repl, svg) + # There's a pointless difference between what qrcode 6.1 generates on + # my Python 3.7 (w/o space) and on Travis Python 3.7. I don't know + # what's to blame, so just patch that. + svg = svg.replace(' />', '/>') return [nodes.raw('', svg, format='html')] def register_mcss(**kwargs): diff --git a/plugins/m/test/qr/page-py36.html b/plugins/m/test/qr/page-py36.html index f0a82cff..47b954bc 100644 --- a/plugins/m/test/qr/page-py36.html +++ b/plugins/m/test/qr/page-py36.html @@ -24,9 +24,9 @@

m.qr

Default:

-

Large stuff inside:

-

Large stuff inside, scaled down.

- +

Large stuff inside:

+

Large stuff inside, scaled down.

+ -- 2.30.2