Browse Source

* Text::Dokuwiki::Regexps : steal empty lines after block

master
Alex 'AdUser' Z 9 years ago
parent
commit
2ca3a4da01
  1. 7
      lib/Text/Dokuwiki/Regexps.pm

7
lib/Text/Dokuwiki/Regexps.pm

@ -6,11 +6,13 @@ use utf8;
my $SP = '[\ \t]';
my $EOL = '\r?\n';
my $TAIL = '(?:^\s*$)*';
our $regexps = {};
$regexps->{header} = qr{
^ (?<header> .+ ) $EOL
^ (?<line> [=-]+ ) (?: $EOL | $)
$TAIL
}mx;
$regexps->{codeblock} = qr%
@ -39,6 +41,7 @@ $SP? # maybe one leading space
</\g{tag}> # the same tag as in first line
$SP* # maybe any number of trailing spaces
(?: $EOL | $) # end of last line
$TAIL # one or more empty lines
%mx;
$regexps->{table} = qr/
@ -53,6 +56,7 @@ $regexps->{table} = qr/
(?: $EOL | $ ) # newline or file end
)+ # one or more such lines
)
$TAIL # one or more empty lines
/mx;
$regexps->{pre} = qr/
@ -64,6 +68,7 @@ $regexps->{pre} = qr/
(?: $EOL | $ ) # newline or file end
)+ # one or more lines
)
$TAIL # one or more empty lines
/mx;
$regexps->{blockquote} = qr/
@ -76,6 +81,7 @@ $regexps->{blockquote} = qr/
(?: $EOL | $ ) # newline or file end
)+ # one or more lines
)
$TAIL # one or more empty lines
/mx;
$regexps->{list} = qr/
@ -88,6 +94,7 @@ $regexps->{list} = qr/
(?: $EOL | $ ) # newline or file end
)+ # one or more lines
)
$TAIL # one or more empty lines
/mx;
1;

Loading…
Cancel
Save