3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 11:12:42 +01:00

Improved matching of tags in cc diff to be less greedy

This commit is contained in:
Pragmatic Software 2013-08-23 22:26:32 +00:00
parent e6ae49fd4f
commit cb74a9be1e
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 423,
BUILD_REVISION => 424,
BUILD_DATE => "2013-08-23",
};

View File

@ -188,7 +188,7 @@ if($code =~ m/^\s*diff\s*$/i) {
my $diff = word_diff \$last_code[1], \$last_code[0], { STYLE => 'MARKUP' };
$diff =~ s/<del>([^\s]+)(\s+)<\/del>/<del>$1<\/del>$2/g;
$diff =~ s/<ins>([^\s]+)(\s+)<\/ins>/<ins>$1<\/ins>$2/g;
$diff =~ s/<del>(.*?)<\/del>\s*<ins>(.*?)<\/ins>/<replaced `$1` with `$2`>/g;
$diff =~ s/<del>((?:(?!<del>).)*)<\/del>\s*<ins>((?:(?!<ins>).)*)<\/ins>/<replaced `$1` with `$2`>/g;
$diff =~ s/<del>(.*?)<\/del>/<removed `$1`>/g;
$diff =~ s/<ins>(.*?)<\/ins>/<inserted `$1`>/g;