]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Hval.pm
nntp: cmd_xrover: use named sub for long_response
[public-inbox.git] / lib / PublicInbox / Hval.pm
index 0e290601f2a0d74284f4b24278e7eeab8c973137..4a79439f8e27f23f320ed05e288b5d8848150fef 100644 (file)
@@ -32,14 +32,6 @@ sub new_msgid {
        $class->new($msgid, mid_escape($msgid));
 }
 
-sub new_oneline {
-       my ($class, $raw) = @_;
-       $raw = '' unless defined $raw;
-       $raw =~ tr/\t\n / /s; # squeeze spaces
-       $raw =~ tr/\r//d; # kill CR
-       $class->new($raw);
-}
-
 # some of these overrides are standard C escapes so they're
 # easy-to-understand when rendered.
 my %escape_sequence = (
@@ -66,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);
 }