summaryrefslogtreecommitdiff
path: root/pandoc-cs1
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2014-12-30 18:29:07 +0100
committerJonas Smedegaard <dr@jones.dk>2014-12-30 18:29:07 +0100
commitc3503359723312ce7d26f102812328dce3063b7b (patch)
tree06938931d059c1a3ab9d4c404caebd9ac8991c7d /pandoc-cs1
parentfee2f3a48759f1581eb4a0c83815be9162ad5e4f (diff)
Declare that switch feature is used (not perl version providing it), and fully use it.
Diffstat (limited to 'pandoc-cs1')
-rwxr-xr-xpandoc-cs14
1 files changed, 2 insertions, 2 deletions
diff --git a/pandoc-cs1 b/pandoc-cs1
index 27ba8d4..506565a 100755
--- a/pandoc-cs1
+++ b/pandoc-cs1
@@ -3,7 +3,7 @@
use warnings;
use strict;
-use v5.10.1; # use switch keyword "when" (but avoid too complex "given")
+use feature qw(switch);
no if $] >= 5.018, warnings => "experimental::smartmatch";
use Pandoc::Filter;
@@ -21,7 +21,7 @@ pandoc_filter sub {
my $self = shift;
return unless ($self->name eq 'RawInline' and $self->format eq 'mediawiki');
- for ($self->content) {
+ given ($self->content) {
when (/^{{cite\s+(\w+)\s*\|([^}]*)}}$/) {
my $id = 'ref'.++$i;
my @data = pairmap { $b =~ s/"/\\"/g; "$a=\"$b\"" }