]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/hl_mod: workaround w3m not handling '
authorEric Wong <e@80x24.org>
Fri, 19 Apr 2019 08:09:31 +0000 (08:09 +0000)
committerEric Wong <e@80x24.org>
Fri, 19 Apr 2019 08:12:55 +0000 (08:12 +0000)
This fixes a test failure on my Debian buster system.

Bug report filed for w3m to handle "&apos;":

https://bugs.debian.org/927409

and for "highlight" to favor "&#39;" in case other browsers fail:

https://bugs.debian.org/927410

t/hl_mod.t

index 84a4b5766873ba733041c87819450bbfa9dc3fc5..fc7b712cea6945a4031274e63d0c05c6ed669e16 100644 (file)
@@ -30,6 +30,10 @@ my $orig = $str;
                require File::Temp;
                my $cmd = [ qw(w3m -T text/html -dump -config /dev/null) ];
                my ($out, $err) = ('', '');
+
+               # workaround https://bugs.debian.org/927409
+               $$ref =~ s/&apos;/&#39;/sg;
+
                IPC::Run::run($cmd, \('<pre>'.$$ref.'</pre>'), \$out, \$err);
                # expand tabs and normalize whitespace,
                # w3m doesn't preserve tabs