From: Eric Wong Date: Sun, 27 Jan 2019 11:36:22 +0000 (+0000) Subject: hlmod: disable enclosing
 tag
X-Git-Tag: v1.2.0~397^2~12
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fd8e62c1ed9b9f7eb851a263a9ada2cb8c182193;p=public-inbox.git

hlmod: disable enclosing 
 tag

We already have a 
 tag in ViewVCS, and nesting 
inside the pre-existing 
 overrides the "white-space:pre"
we use to align line numbers.
---

diff --git a/lib/PublicInbox/HlMod.pm b/lib/PublicInbox/HlMod.pm
index 5cbfb298..237ffaca 100644
--- a/lib/PublicInbox/HlMod.pm
+++ b/lib/PublicInbox/HlMod.pm
@@ -99,7 +99,6 @@ sub do_hl {
 	my $gen = $self->{$langpath} ||= do {
 		my $g = highlight::CodeGenerator::getInstance($highlight::HTML);
 		$g->setFragmentCode(1); # generate html fragment
-		$g->setHTMLEnclosePreTag(1); # include 
 
 		# whatever theme works
 		my $themepath = $dir->getThemePath('print.theme');
diff --git a/t/hl_mod.t b/t/hl_mod.t
index 62cc6248..80f88907 100644
--- a/t/hl_mod.t
+++ b/t/hl_mod.t
@@ -27,7 +27,7 @@ my $orig = $str;
 		require File::Temp;
 		my $cmd = [ qw(w3m -T text/html -dump -config /dev/null) ];
 		my ($out, $err) = ('', '');
-		IPC::Run::run($cmd, $ref, \$out, \$err);
+		IPC::Run::run($cmd, \('
'.$$ref.'
'), \$out, \$err); # expand tabs and normalize whitespace, # w3m doesn't preserve tabs $orig =~ s/\t/ /gs;