Browse Source

* '%%' inline handler

master
Zubrikhin Alexey 9 years ago
parent
commit
509cf2a25e
  1. 4
      lib/Text/Dokuwiki/Parser.pm

4
lib/Text/Dokuwiki/Parser.pm

@ -158,6 +158,7 @@ sub _parse_include {
} }
my $inlines = { my $inlines = {
"%%" => "%%", # nowiki
"__" => "__", # underline "__" => "__", # underline
"//" => "//", # italic "//" => "//", # italic
"**" => "**", # bold "**" => "**", # bold
@ -172,7 +173,7 @@ sub _parse_text {
my @parts = (); my @parts = ();
while ($line) { while ($line) {
$line =~ m!^(?:(.*?)(__|//|''|\*\*|\[\[|\{\{|\(\(|\\\\ ))?(.*)!o; $line =~ m!^(?:(.*?)(%%|__|//|''|\*\*|\[\[|\{\{|\(\(|\\\\ ))?(.*)!o;
my ($before, $match, $after) = ($1, $2, $3); my ($before, $match, $after) = ($1, $2, $3);
if ($before) { if ($before) {
push @parts, $before; push @parts, $before;
@ -207,6 +208,7 @@ sub _parse_text {
elsif ($match eq "''") { $tag = 'code'; } elsif ($match eq "''") { $tag = 'code'; }
elsif ($match eq "{{") { push @parts, $self->_parse_include($content); next; } elsif ($match eq "{{") { push @parts, $self->_parse_include($content); next; }
elsif ($match eq "[[") { push @parts, $self->_parse_link($content); next; } elsif ($match eq "[[") { push @parts, $self->_parse_link($content); next; }
elsif ($match eq "%%") { push @parts, $content; next; }
elsif ($match eq "((") { elsif ($match eq "((") {
push @{ $self->{footnotes} }, $self->_parse_text($content); push @{ $self->{footnotes} }, $self->_parse_text($content);
my $n = scalar @{ $self->{footnotes} }; my $n = scalar @{ $self->{footnotes} };

Loading…
Cancel
Save