From 6025d9881c00a0d4b538f06ce157eed416045e10 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Jan 2019 11:43:56 +0000 Subject: hval: add src_escape for highlight post-processing We need to post-process "highlight" output to ensure it doesn't contain odd bytes which cause "wide character" warnings or require odd glyphs in source form. --- lib/PublicInbox/ViewVCS.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/ViewVCS.pm') diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index a8aa0b61..63e503d8 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -20,7 +20,7 @@ use Encode qw(find_encoding); use PublicInbox::SolverGit; use PublicInbox::WwwStream; use PublicInbox::Linkify; -use PublicInbox::Hval qw(ascii_html to_filename); +use PublicInbox::Hval qw(ascii_html to_filename src_escape); my $hl = eval { require PublicInbox::HlMod; PublicInbox::HlMod->new; @@ -96,6 +96,8 @@ sub solve_result { $l->linkify_1($$blob); my $ok = $hl->do_hl($blob, $path) if $hl; if ($ok) { + $$ok = $enc_utf8->decode($$ok); + src_escape($$ok); $blob = $ok; } else { $$blob = ascii_html($$blob); -- cgit v1.2.3-24-ge0c7