From ecf084d1f59f34f24eefbf0c64159ca96b489f73 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 31 Oct 2019 09:19:38 +0000 Subject: hval: replace "'" with "'" for compatibility While testing 216light.css changes, I managed to hit some cases where dillo failed to render ' correctly, but I also can't reproduce it reliably. Anyways, it's definitely a problem with some old browsers and newer versions of highlight already work around it, but Debian 10.x has 3.41, so use "'" to maximize compatibility. --- lib/PublicInbox/Hval.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/PublicInbox/Hval.pm') diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm index c134e297..4a79439f 100644 --- a/lib/PublicInbox/Hval.pm +++ b/lib/PublicInbox/Hval.pm @@ -58,8 +58,11 @@ my %xhtml_map = ( $xhtml_map{chr($_)} = sprintf('\\x%02x', $_) for (0..31); %xhtml_map = (%xhtml_map, %escape_sequence); +# for post-processing the output of highlight.pm and perhaps other +# highlighers in the future sub src_escape ($) { $_[0] =~ s/\r\n/\n/sg; + $_[0] =~ s/'/'/sg; # workaround https://bugs.debian.org/927409 $_[0] =~ s/([\x7f\x00-\x1f])/$xhtml_map{$1}/sge; $_[0] = $enc_ascii->encode($_[0], Encode::HTMLCREF); } -- cgit v1.2.3-24-ge0c7