Skip to content

Commit

Permalink
[Text::Markup::Wiki::MediaWiki] fixed a bug
Browse files Browse the repository at this point in the history
Spaces are now allowed in internal links. Closes #14.
  • Loading branch information
Carl Masak committed Jun 23, 2009
1 parent 660b30c commit 43c37cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/November.pm
Expand Up @@ -329,7 +329,8 @@ class November does Session does Cache {
$.cgi.send_response($template.output, %opts);
}

method make_link($page, $title) {
method make_link($page is copy, $title) {
$page .= subst(' ', '_', :g);
my $root = $!config.web_root;
if $title {
if $page ~~ m/':'/ {
Expand Down
2 changes: 1 addition & 1 deletion lib/Text/Markup/Wiki/MediaWiki.pm
Expand Up @@ -8,7 +8,7 @@ grammar Tokenizer {
regex italic_marker { '''' }

regex wikilink { '[[' \s* <page> \s* ']]' }
regex page { [<!before ']]'> \S]+ }
regex page { [<!before ']]'> \N]+<!after \s> }

regex extlink { '[' \s* <url> [\s+ <title>]? \s* ']' }
regex url { [<!before ']'> \S]+ }
Expand Down
1 change: 1 addition & 0 deletions t/markup/mediawiki/06-links.t
Expand Up @@ -9,6 +9,7 @@ my $converter = Text::Markup::Wiki::MediaWiki.new;
my $link_maker = {
my $l = $^page.ucfirst;
my $t = $^title // $^page;
$l .= subst(' ', '_', :g);
"<a href=\"/?page=$l\">$t</a>"
}
my $extlink_maker = { "<a href=\"$^href\">$^title</a>" }
Expand Down

0 comments on commit 43c37cb

Please sign in to comment.