summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-03-25 04:16:34 +0100
committerJonas Smedegaard <dr@jones.dk>2015-03-25 04:16:34 +0100
commitcdfb76e5ae4819eca5a95fb2a35a7ddabebef768 (patch)
tree3e52377aaaf02bf9b92f3035c3a68e85517dd611
parent3bd9c775960123f7c5691a19b47ef1eaff80c088 (diff)
Use en-dash with simple number ranges.
-rwxr-xr-xnative-hacks2
1 files changed, 2 insertions, 0 deletions
diff --git a/native-hacks b/native-hacks
index dca1520..e0f2318 100755
--- a/native-hacks
+++ b/native-hacks
@@ -14,7 +14,9 @@ my $outfile = shift || $infile;
$_ = path($infile)->slurp_utf8;
# "pandoc --smart" apparently ignores en- and em-dashes with mediawiki.
+# TODO: handle more ranges (e.g. roman numbers or single letters as first part)
s/Space,Str "--",Space/Space,Str "\\8212",Space/g;
+s/(Str "\d+)-(\d+")/$1", Str "\\8211", Str "$2/g;
path($outfile)->spew_utf8($_);