From: Darold Date: Fri, 22 Jun 2012 22:18:41 +0000 (+0200) Subject: Fix issue #10 where != was replaced by $$CLASSSY0A$$!=$$CLASSSY0B$$ in the output... X-Git-Tag: v3.2~225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4091168382a010e9ce908f83a7a1ff4665bd93b9;p=pgbadger Fix issue #10 where != was replaced by $$CLASSSY0A$$!=$$CLASSSY0B$$ in the output - Isaac Reuben --- diff --git a/pgbadger b/pgbadger index 49ad4df..78d2fc1 100755 --- a/pgbadger +++ b/pgbadger @@ -272,7 +272,7 @@ my @KEYWORDS2 = ( my @KEYWORDS3 = ( 'STDIN', 'STDOUT' ); -my %SYMBOLS = ( '=' => '=', '<' => '<', '>' => '>', '\|' => '|', ',' => ',', '\.' => '.', '\+' => '+', '\-' => '-', '\*' => '*', '\/' => '/', '\!=' => '!=' ); +my %SYMBOLS = ( '=' => '=', '<' => '<', '>' => '>', '\|' => '|', ',' => ',', '\.' => '.', '\+' => '+', '\-' => '-', '\*' => '*', '\/' => '/', '!=' => '!=' ); my @BRACKETS = ( '(', ')' ); map { $_ = quotemeta($_) } @BRACKETS; @@ -2307,11 +2307,11 @@ sub highlight_code return $code if ($nohighlight); foreach my $x (keys %SYMBOLS) { - $code =~ s/$x/\$\$CLASSSY0A\$\$$SYMBOLS{$x}\$\$CLASSSY0B\$\$/igs; + $code =~ s/$x/\$\$CLASSSY0A\$\$$SYMBOLS{$x}\$\$CLASSSY0B\$\$/gs; } #$code =~ s/("[^"]*")/$1<\/span>/igs; - $code =~ s/('[^']*')/$1<\/span>/igs; - $code =~ s/(`[^`]*`)/$1<\/span>/igs; + $code =~ s/('[^']*')/$1<\/span>/gs; + $code =~ s/(`[^`]*`)/$1<\/span>/gs; for (my $x = 0; $x <= $#KEYWORDS1; $x++) { #$code =~ s/\b($KEYWORDS1[$x])\b/$1<\/span>/igs; @@ -2328,7 +2328,7 @@ sub highlight_code for (my $x = 0; $x <= $#BRACKETS; $x++) { $code =~ s/($BRACKETS[$x])/$1<\/span>/igs; } - $code =~ s/\$\$CLASSSY0A\$\$([^\$]+)\$\$CLASSSY0B\$\$/$1<\/span>/igs; + $code =~ s/\$\$CLASSSY0A\$\$([^\$]+)\$\$CLASSSY0B\$\$/$1<\/span>/gs; $code =~ s/\b(\d+)\b/$1<\/span>/igs;