Browse Source

= Text::Dokuwiki::Parser->_parse_include

master
Alex 'AdUser' Z 10 years ago
parent
commit
c55c2a1b56
  1. 8
      lib/Text/Dokuwiki/Parser.pm

8
lib/Text/Dokuwiki/Parser.pm

@ -119,18 +119,18 @@ sub _parse_link {
sub _parse_include { sub _parse_include {
my ($self, $content) = @_; my ($self, $content) = @_;
if ($content =~ m|{{([a-z]+)>(.*)}}|oi) { if ($content =~ m|^([a-z]+)>(.*)|oi) {
... ...
} }
my ($lpad, $rpad, $src, %attrs) = ('', '', ''); my ($lpad, $rpad, $src, %attrs) = ('', '', '');
if ($content =~ m!^{{(\s*)([^\s\|]+)(\s*)\|(.*)}}!oi) { if ($content =~ m!^(\s*)([^\s\|]+)(\s*)[|](.*)!oi) {
($lpad, $src, $rpad) = ($1, $2, $3); ($lpad, $src, $rpad) = ($1, $2, $3);
$attrs{title} = $4; $attrs{title} = $4;
} elsif ($content =~ m!^{{(\s*)(\S+)(\s*)}}!) { } elsif ($content =~ m!^(\s*)(\S+)(\s*)!) {
($lpad, $src, $rpad) = ($1, $2, $3); ($lpad, $src, $rpad) = ($1, $2, $3);
} else { } else {
($src) = ($content =~ s/{{(.+)}}/$1/or); ($src) = ($content =~ s/^(.+)/$1/or);
} }
$attrs{align} = ($lpad ne '') $attrs{align} = ($lpad ne '')

Loading…
Cancel
Save