|
|
|
@ -11,36 +11,34 @@ my $rx = $Text::Dokuwiki::Regexps::regexps;
|
|
|
|
|
use re 'debugcolor'; |
|
|
|
|
my $text = <<'TEXT'; |
|
|
|
|
|
|
|
|
|
Header 1st level |
|
|
|
|
================= |
|
|
|
|
====== Header 1st level ====== |
|
|
|
|
|
|
|
|
|
TEXT |
|
|
|
|
my $matched = 'Header 1st level'; |
|
|
|
|
|
|
|
|
|
my @matches = $text =~ m/$rx->{header}/; |
|
|
|
|
is(scalar @matches, 2); |
|
|
|
|
is($+{line}, '======'); |
|
|
|
|
is($+{header}, $matched); |
|
|
|
|
is($+{line}, '================='); |
|
|
|
|
is($matches[0], $matched); |
|
|
|
|
is($matches[1], '================='); |
|
|
|
|
is($matches[0], '======'); |
|
|
|
|
is($matches[1], $matched); |
|
|
|
|
|
|
|
|
|
$text = <<'TEXT'; |
|
|
|
|
|
|
|
|
|
Header 2nd level |
|
|
|
|
----------------- |
|
|
|
|
===== Header 2nd level ===== |
|
|
|
|
|
|
|
|
|
TEXT |
|
|
|
|
$matched = 'Header 2nd level'; |
|
|
|
|
@matches = $text =~ m/$rx->{header}/; |
|
|
|
|
is(scalar @matches, 2); |
|
|
|
|
is($matches[0], $matched); |
|
|
|
|
is($matches[1], '-----------------'); |
|
|
|
|
is($matches[0], '====='); |
|
|
|
|
is($matches[1], $matched); |
|
|
|
|
|
|
|
|
|
$text = "Header only\n-------------"; |
|
|
|
|
$text = "==== Header only ===="; |
|
|
|
|
$matched = 'Header only'; |
|
|
|
|
@matches = $text =~ m/$rx->{header}/; |
|
|
|
|
is($matches[0], $matched); |
|
|
|
|
is($matches[1], '-------------'); |
|
|
|
|
is($matches[0], '===='); |
|
|
|
|
is($matches[1], $matched); |
|
|
|
|
|
|
|
|
|
$text = <<'TEXT'; |
|
|
|
|
|
|
|
|
|