summaryrefslogtreecommitdiff
path: root/fixupdiff.pl
diff options
context:
space:
mode:
Diffstat (limited to 'fixupdiff.pl')
-rwxr-xr-xfixupdiff.pl25
1 files changed, 22 insertions, 3 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl
index 69d4e6e..ce30692 100755
--- a/fixupdiff.pl
+++ b/fixupdiff.pl
@@ -13,6 +13,25 @@ s/\\DIFdelbegin \\DIFdel{([^}]*)}\\DIFdelend/\\DIFdeltext{$1}/;
s/\\DIFaddbegin \\DIFadd{([^}]*)}\\DIFaddend/\\DIFaddtext{$1}/;
# external \color does not seem to apply to footnotes.
-# detect and replace with \textcolor within footnotes
-s/(\\footnote\s*{[^}]*)\\DIFadd{/$1\\DIFaddtext{$2/;
-s/(\\footnote\s*{[^}]*)\\DIFdel{/$1\\DIFdeltext{$2/;
+# detect and replace with \color within footnotes
+
+if (m/\\DIFaddbegin/) {
+ $diffadd=1;
+}
+if (m/\\DIFaddend/) {
+ $diffadd=0;
+}
+if (m/\\DIFdelbegin/) {
+ $diffdel=1;
+}
+if (m/\\DIFdelend/) {
+ $diffdel=0;
+}
+
+if ($diffadd) {
+s/(\\footnote\s*{)/$1\\DIFaddbegin{}/;
+}
+
+if ($diffdel) {
+s/(\\footnote\s*{)/$1\\DIFdelbegin{}/;
+}