summaryrefslogtreecommitdiff
path: root/pandoc-cs1
diff options
context:
space:
mode:
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\"" }