From 0577ed7498cb9dd431a9da23fa316c6bed9d6673 Mon Sep 17 00:00:00 2001 From: "protze@itc.rwth-aachen.de" Date: Thu, 9 Mar 2017 18:02:24 +0100 Subject: [PATCH] restore \item, even if there is an unsafe command after the item --- latexdiff | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/latexdiff b/latexdiff index e471a88..8fa6899 100755 --- a/latexdiff +++ b/latexdiff @@ -2819,7 +2819,7 @@ sub postprocess { sub restore_item_commands { my ($string)=@_ ; my ($itemarg,@itemargs); - $string =~ s/(\%DIFDELCMD < \s*(\\$ITEMCMD)((?:<$abrat0>)?)((?:\[$brat0\])?)\s*?(?:\n|$DELCMDCLOSE))/ + $string =~ s/(\%DIFDELCMD < \s*(\\$ITEMCMD)((?:<$abrat0>)?)((?:\[$brat0\])?)\s*((?:$cmdoptseq)?)\s*?(?:\n|$DELCMDCLOSE))/ # if \item has an []argument, then mark up the argument as deleted) if (length($4)>0) { # use substr to exclude square brackets at end points @@ -2828,7 +2828,8 @@ sub restore_item_commands { } else { $itemarg=""; } - "$1$2$3$itemarg$AUXCMD\n"/sge; + "$2$3$itemarg$AUXCMD\n".((length($5)>0) ? "%DIFDELCMD $5 $DELCMDCLOSE\n" : "") + /sge; return($string); }