From 2ca3a4da011efd06f37896da5d82f147796ddcf6 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sun, 5 Jul 2015 12:16:21 +1000 Subject: [PATCH] * Text::Dokuwiki::Regexps : steal empty lines after block --- lib/Text/Dokuwiki/Regexps.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Text/Dokuwiki/Regexps.pm b/lib/Text/Dokuwiki/Regexps.pm index bb1f854..cc53f4d 100644 --- a/lib/Text/Dokuwiki/Regexps.pm +++ b/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{ ^ (?
.+ ) $EOL ^ (? [=-]+ ) (?: $EOL | $) +$TAIL }mx; $regexps->{codeblock} = qr% @@ -39,6 +41,7 @@ $SP? # maybe one leading space # 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;