diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-12-30 18:29:07 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-12-30 18:29:07 +0100 |
commit | c3503359723312ce7d26f102812328dce3063b7b (patch) | |
tree | 06938931d059c1a3ab9d4c404caebd9ac8991c7d /pandoc-cs1 | |
parent | fee2f3a48759f1581eb4a0c83815be9162ad5e4f (diff) |
Declare that switch feature is used (not perl version providing it), and fully use it.
Diffstat (limited to 'pandoc-cs1')
-rwxr-xr-x | pandoc-cs1 | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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\"" } |