Compare commits

..

25 Commits
2.3.8 ... 2.3.9

Author SHA1 Message Date
Alex Schroeder
a3cbd8db8b Fixed mojolicious-namespaces hack
This is apparently no longer necessary with Perl 5.26.
2017-11-03 18:41:33 +01:00
Alex Schroeder
90e92c27b8 Perl 5.26 no longer adds . to @INC
More changes required, finding more places where do or require is
used.
2017-11-03 18:37:52 +01:00
Alex Schroeder
76b433c1da Perl 5.26 no longer adds . to @INC
More changes required, such as server.pl requiring wiki.pl in the
current directory, which isn't in @INC anymore.
2017-11-03 18:00:50 +01:00
Alex Schroeder
b116a0103e Perl 5.26 no longer adds . to @INC
This is why all the tests requiring t/test.pl had to be changed.
Similarly, the main script loads config and modules using the same
mechanism and paths had to be similarly qualified: prepending './'.
2017-11-03 17:51:30 +01:00
Alex Schroeder
6a7a0dd24d Makefile: Don't set PERL5LIB if it is already set 2017-11-03 13:05:46 +01:00
Alex Schroeder
c2366aa36f Test: give Mojolious server a sec to start up 2017-11-03 11:03:42 +01:00
Alex Schroeder
4da50ef125 Summary: Export PERL5LIB for Alexine
Try again, now using the current directory in the test target of the
Makefile instead of changing run-tests.
2017-11-03 10:48:16 +01:00
Alex Schroeder
2e0f293dcd Export PERL5LIB for Alexine
Try again, now using ODDMUSE_TEST_LOCATION instead of the current
directory.
2017-11-03 10:45:05 +01:00
Alex Schroeder
d0095a36b5 Export PERL5LIB for Alexine 2017-11-03 10:15:01 +01:00
Alex Schroeder
1eae7852c4 Set PERL5LIB for Alexine 2017-11-03 10:12:57 +01:00
Alex Schroeder
da06278df8 Fixed display of comment pages
There was a bug where showing the non-existing comment page for an
existing page: BrowseResolvedPage used to return BrowsePage($id,
GetParam('raw', 0), undef, '404 NOT FOUND') and we wanted to change
this to a 200 response and so we returned BrowsePage($resolved,
GetParam('raw', 0)); -- but that is wrong because in this situation
$id is defined and $resolved is not! This commit fixes the problem.
2017-11-03 10:03:39 +01:00
Alex Schroeder
bd8f914804 Use lib '.' for Alexine 2017-11-03 10:02:42 +01:00
Alex Schroeder
51b24309a7 Allow exclamation mark in page names 2017-11-02 14:06:30 +01:00
Alex Schroeder
60a4572087 creole: fix left alignment of th 2017-11-01 16:51:23 +01:00
Alex Schroeder
248af821a7 Comment pages and $CommentsPattern, again
If $CommentsPattern is a regular expression that matches without
setting $1, we want to avoid the “Use of uninitialized value $1 in
hash element” warning.
2017-10-30 15:56:06 +01:00
Alex Schroeder
c85e8b84b9 Don't return 404 for empty comment pages 2017-10-30 14:16:12 +01:00
Alex Schroeder
e4d159307b Add .gitattributes
GitHub uses Linguist to identify source code and .pl files are
sometimes classified as Prolog files. There are various ways to
override this. Using .gitattributes seems to be the easiest.
https://github.com/github/linguist#overrides

Similar issue:
https://github.com/github/linguist/issues/3230
2017-10-23 07:45:20 +02:00
Alex Schroeder
80a30a9102 ignore TAGS 2017-09-07 22:50:08 +02:00
Alex Schroeder
299b94243d ditaa and mermaid modules added 2017-09-07 22:27:47 +02:00
Alex Schroeder
b7ab45a3a7 wiki.css: only p > a.definition looks like h2 2017-08-29 16:49:54 +02:00
Alex Schroeder
9d3deaff0f permanent-anchors: fix dirty block return 2017-08-29 16:44:08 +02:00
Alex Schroeder
42a1e389a5 namespaces: sort the result of the namespace action 2017-08-29 15:39:08 +02:00
Alex Schroeder
9883a064f3 markdown-rule fixes for _foo_, *foo* and /foo/ 2017-08-28 11:42:02 +02:00
Alex Schroeder
52617b472d bbcode must come after markdown 2017-08-16 09:31:51 +02:00
Alex Schroeder
764c15e6c0 Fixed small bug in release file 2017-08-11 20:47:16 +02:00
157 changed files with 480 additions and 234 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
*.pl linguist-language=Perl

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@
.DS_Store
wiki.log
.prove
TAGS

View File

@@ -51,13 +51,13 @@ a.image:hover img {
}
/* a.definition soll aussehen wie h2 */
h2, p a.definition {
h2, p > a.definition {
display: block;
clear: both;
}
/* Such Link im h1 soll nicht auffallen. */
h1, h2, h3, h4, h1 a, h1 a:visited, p a.definition {
h1, h2, h3, h4, h1 a, h1 a:visited, p > a.definition {
color: #666;
font-size: 30pt;
font-weight: normal;

View File

@@ -19,7 +19,7 @@ AddModuleDescription('bbcode.pl', 'bbCode Extension');
our ($q, @HtmlStack, @MyRules, %RuleOrder, $UrlProtocols, $FullUrlPattern);
push(@MyRules, \&bbCodeRule);
$RuleOrder{\&bbCodeRule} = 100; # must come after PortraitSupportRule
$RuleOrder{\&bbCodeRule} = 300; # must come after PortraitSupportRule, MarkdownRule
our ($bbBlock);
my %bbTitle = qw(h1 1 h2 1 h3 1 h4 1 h5 1 h6 1);

View File

@@ -405,8 +405,7 @@ sub CreoleRule {
if ($is_left_justified and
$is_right_justified) { $attributes .= 'align="center"' }
elsif ($is_right_justified) { $attributes .= 'align="right"' }
# this is the default:
# elsif ($is_left_justified) { $attributes .= 'align="left"' }
elsif ($is_left_justified) { $attributes .= 'align="left"' }
return
(InElement('td') || InElement('th') ? CloseHtmlEnvironmentUntil('tr') : '')

49
modules/ditaa.pl Normal file
View File

@@ -0,0 +1,49 @@
#! /usr/bin/perl
# Copyright (C) 20152017 Alex Schroeder <alex@gnu.org>
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('ditaa.pl', 'Ditaa for Diagrams');
our ($q, $bol, @MyRules, @KnownLocks, $TempDir);
push (@MyRules, \&DitaaRule);
push(@KnownLocks, 'diagram');
sub DitaaRule {
if ($bol && m/\G&lt;diagram(\s+style=".*")?&gt;\n((.*\n)+)&lt;\/diagram&gt;/cg) {
return "MIME::Base64 not installed" unless eval { require MIME::Base64; };
my $style = $1;
my $map = UnquoteHtml($2);
RequestLockDir('diagram', undef, undef, 1);
WriteStringToFile("$TempDir/diagram.txt", $map);
$ENV{LANG}='en_US.UTF-8'; # Java needs Locale to match as well!
my $output = `ditaa "$TempDir/diagram.txt" "$TempDir/diagram.png"`;
my $image = '';
# not UTF-8 layer!
if (open(IN, '<', "$TempDir/diagram.png")) {
local $/ = undef; # Read complete files
$image = <IN>;
close IN;
}
ReleaseLockDir('diagram');
my $data = MIME::Base64::encode_base64($image);
my $url = "data:image/png;base64,$data";
return CloseHtmlEnvironments()
. "<div$style>" . $q->img({-src=>$url, -alt=>$map}) . "</div>";
}
return undef;
}

View File

@@ -76,8 +76,8 @@ sub LoadLanguage {
next unless $file; # file is not listed, eg. there is no file for "de-ch"
$file = "$LoadLanguageDir/$file" if defined $LoadLanguageDir;
if (IsFile($file)) {
do $file;
do "$ConfigFile-$Lang{$_}" if IsFile("$ConfigFile-$Lang{$_}");
do "./$file";
do "./$ConfigFile-$Lang{$_}" if IsFile("$ConfigFile-$Lang{$_}");
$CurrentLanguage = $Lang{$_};
last;
}

View File

@@ -80,13 +80,13 @@ sub MarkdownRule {
elsif (m/\G\*\*/cg) {
return AddOrCloseHtmlEnvironment('strong');
}
# *italic*
elsif ($bol and m/\G\*/cg or m/\G(?<=\P{Word})\*/cg) {
return AddHtmlEnvironment('em');
}
# *italic* (closing before adding environment!)
elsif (InElement('em') and m/\G\*/cg) {
return CloseHtmlEnvironment('em');
}
elsif ($bol and m/\G\*/cg or m/\G(?<=\P{Word})\*/cg) {
return AddHtmlEnvironment('em');
}
# ~~strikethrough~~ (deleted)
elsif (m/\G~~/cg) {
return AddOrCloseHtmlEnvironment('del');
@@ -186,23 +186,23 @@ sub MarkdownExtraRule {
if (m/\G__/cg) {
return AddOrCloseHtmlEnvironment('em', 'style="font-style: normal; text-decoration: underline"');
}
# _underline_
elsif ($bol and m/\G_/cg or m/\G(?<=\P{Word})_/cg) {
return AddHtmlEnvironment('em', 'style="font-style: normal; text-decoration: underline"');
}
# _underline_ (closing before adding environment!)
elsif (InElement('em', 'style="font-style: normal; text-decoration: underline"') and m/\G_/cg) {
return CloseHtmlEnvironment('em');
}
elsif ($bol and m/\G_/cg or m/\G(?<=\P{Word})_/cg) {
return AddHtmlEnvironment('em', 'style="font-style: normal; text-decoration: underline"');
}
# //italic//
elsif (m/\G\/\//cg) {
return AddOrCloseHtmlEnvironment('em');
}
# /italic/
elsif ($bol and m/\G\//cg or m/\G(?<=\P{Word})\//cg) {
return AddHtmlEnvironment('em');
}
# /italic/ (closing before adding environment!)
elsif (InElement('em') and m/\G\//cg) {
return CloseHtmlEnvironment('em');
}
elsif ($bol and m/\G\//cg or m/\G(?<=\P{Word})\//cg) {
return AddHtmlEnvironment('em');
}
return;
}

73
modules/mermaid.pl Normal file
View File

@@ -0,0 +1,73 @@
#! /usr/bin/perl
# Copyright (C) 2017 Alex Schroeder <alex@gnu.org>
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
use strict;
use v5.10;
AddModuleDescription('mermaid.pl', 'Mermaid for Diagrams');
our ($bol, @MyRules, $MermaidCss, $MermaidJs, $HtmlHeaders, %Page);
$MermaidCss = '/mermaid/mermaid.css';
$MermaidJs = '/mermaid/mermaid.min.js';
# When browsing a page containing mermaid markup, load the mermaid Javascript and CSS
*MermaidOldBrowsePage = *BrowsePage;
*BrowsePage = *MermaidNewBrowsePage;
sub MermaidNewBrowsePage {
my ($id) = @_;
OpenPage($id);
# Uses <mermaid> to render graphs
if ($Page{text} =~ /<mermaid>/
and $HtmlHeaders !~ /mermaid/) {
$HtmlHeaders .= qq{
<link type="text/css" rel="stylesheet" href="$MermaidCss" />
<script type="text/javascript" src="$MermaidJs"></script>
};
}
return MermaidOldBrowsePage(@_);
}
# When previewing an edit containing mermaid markup, load the mermaid Javascript
# and CSS
*MermaidOldDoEdit = *DoEdit;
*DoEdit = *MermaidNewDoEdit;
sub MermaidNewDoEdit {
# Uses <mermaid> to render graphs
if (GetParam('text') =~ /&lt;mermaid&gt;/
and $HtmlHeaders !~ /mermaid/) {
$HtmlHeaders = q{
<link rel="stylesheet" href="/mermaid/mermaid.css" />
<script type="text/javascript" src="/mermaid/mermaid.min.js"></script>
};
}
return MermaidOldDoEdit(@_);
}
# And a formatting rule, of course.
push(@MyRules, \&MermaidRule);
sub MermaidRule {
if ($bol && m/\G\&lt;mermaid\&gt;\n(.+?)\n\&lt;\/mermaid\&gt;/cgs) {
return CloseHtmlEnvironments()
. '<div class="mermaid">' . UrlDecode($1) . '</div>';
}
return undef;
}

View File

@@ -405,7 +405,7 @@ $Action{namespaces} = \&DoNamespacesList;
sub DoNamespacesList {
if (GetParam('raw', 0)) {
print GetHttpHeader('text/plain');
print join("\n", keys %Namespaces), "\n";
print join("\n", sort keys %Namespaces), "\n";
} else {
print GetHeader('', T('Namespaces')),
$q->start_div({-class=>'content namespaces'}),
@@ -413,7 +413,7 @@ sub DoNamespacesList {
GetHiddenValue('id', $HomePage);
my $new = $q->textfield('ns') . ' ' . $q->submit('donamespace', T('Go!'));
print $q->ul($q->li([map { $q->a({-href => $Namespaces{$_} . $HomePage},
$_); } keys %Namespaces]), $q->li($new));
$_); } sort keys %Namespaces]), $q->li($new));
print $q->end_form() . $q->end_div();
PrintFooter();
}

View File

@@ -86,6 +86,7 @@ sub PermanentAnchorsRule {
} else {
print $q->span({-class=>'permanentanchor'}, $2);
}
return '';
}
return;
}

View File

@@ -33,7 +33,7 @@ plugin CGI => {
# WikiDataDir and falls back to the following
# $OddMuse::DataDir = '/tmp/oddmuse';
use warnings;
require 'wiki.pl' unless defined &OddMuse::DoWikiRequest;
require './wiki.pl' unless defined &OddMuse::DoWikiRequest;
},
env => {},
# path to where STDERR from cgi script goes

View File

@@ -33,30 +33,33 @@ EOT
my $min = version->parse(shift || "2.3.0");
my @tags = grep { /\d+\.\d+\.\d+/ and version->parse($_) > $min }
my @tags = grep { /\d+\.\d+\.\d+/ and version->parse($_) >= $min }
split(/\n/, qx{git tag --list});
unless (@tags) {
die "git tag --list produced no list of tags\n";
die "git tag --list produced no list of tags >= $min\n";
}
for my $tag (@tags) {
my $fname = "$dir/oddmuse-$tag.tar.gz";
unless (-f $fname) {
system("git", "checkout", $tag) == 0
or die "Failed to git checkout $tag\n";
system("make", "prepare") == 0
or die "Failed to run make prepare for tag $tag\n";
system("mv", "build", "oddmuse-$tag") == 0
or die "Failed to rename the build directory to oddmuse-$tag\n";
system("tar", "czf", "oddmuse-$tag.tar.gz", "oddmuse-$tag") == 0
or die "Failed to build tarball oddmuse-$tag.tar.gz\n";
system("mv", "oddmuse-$tag.tar.gz", $fname) == 0
or die "Failed to move the tarball oddmuse-$tag.tar.gz\n";
system("rm", "-rf", "oddmuse-$tag") == 0
or die "Failed to remove the directory oddmuse-$tag\n";
if (-f $fname) {
warn "Skipping $tag as $fname already exists\n";
next;
}
print "Preparing $tag\n";
system("git", "checkout", $tag) == 0
or die "Failed to git checkout $tag\n";
system("make", "prepare") == 0
or die "Failed to run make prepare for tag $tag\n";
system("mv", "build", "oddmuse-$tag") == 0
or die "Failed to rename the build directory to oddmuse-$tag\n";
system("tar", "czf", "oddmuse-$tag.tar.gz", "oddmuse-$tag") == 0
or die "Failed to build tarball oddmuse-$tag.tar.gz\n";
system("mv", "oddmuse-$tag.tar.gz", $fname) == 0
or die "Failed to move the tarball oddmuse-$tag.tar.gz\n";
system("rm", "-rf", "oddmuse-$tag") == 0
or die "Failed to remove the directory oddmuse-$tag\n";
}
system("git", "checkout", "master") == 0

View File

@@ -25,7 +25,7 @@ $ENV{WikiDataDir} = $dir if $dir;
use base qw(HTTP::Server::Simple::CGI);
$OddMuse::RunCGI = 0;
do $wiki; # load just once
do "./$wiki"; # load just once
sub handle_request {
my $self = shift;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 24;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 13;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 40;
use utf8; # tests contain UTF-8 characters and it matters

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 11;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 2;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 44;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 4;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 23;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 13;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 39;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 28;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 8;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 12;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 33;

View File

@@ -1,4 +1,4 @@
# Copyright (C) 20062015 Alex Schroeder <alex@gnu.org>
# Copyright (C) 20062017 Alex Schroeder <alex@gnu.org>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
@@ -12,9 +12,9 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 43;
use Test::More tests => 44;
AppendStringToFile($ConfigFile, "\$CommentsPrefix = 'Comments on ';\n");
@@ -34,6 +34,13 @@ xpath_test($page,
'//a[@class="edit"][@href="http://localhost/wiki.pl?action=edit;id=Comments_on_Test"][text()="Edit this page"]',
'//textarea[@name="aftertext"]');
# There used to be a bug where we returned status 200 for a non-existing comment
# page if the corresponding page existed. The bug meant that we browsed a page
# with no title.
update_page('Yes', 'test');
test_page(get_page('Comments_on_Yes'),
'There are no comments, yet. Be the first to leave a comment!');
AppendStringToFile($ConfigFile, "\$EditAllowed = 0;\n");
$page = update_page('Test', 'Cannot edit page with edit allowed eq 0');

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 1;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 26;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 3;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 18;
use utf8;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 4;

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright (C) 2006-2014 Alex Schroeder <alex@gnu.org>
# Copyright (C) 2006-2017 Alex Schroeder <alex@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 111;
use Test::More tests => 112;
add_module('creole.pl');
@@ -144,6 +144,8 @@ foo <hr />
<table class="user"><tr><td>a</td><td>b</td><td>c</td></tr><tr><td>d</td><td>e</td><td>f</td></tr></table>
|=a|=b|=c|\n|d|e|f|
<table class="user"><tr><th>a</th><th>b</th><th>c</th></tr><tr><td>d</td><td>e</td><td>f</td></tr></table>
|= a|= b |=c |\n| d| e |f |
<table class="user"><tr><th align="right">a</th><th align="center">b </th><th align="left">c </th></tr><tr><td align="right">d</td><td align="center">e </td><td align="left">f </td></tr></table>
|=a|b|c|\n|=d|e|f|
<table class="user"><tr><th>a</th><td>b</td><td>c</td></tr><tr><th>d</th><td>e</td><td>f</td></tr></table>
| a| b| c\n| d | e | f |
@@ -161,7 +163,7 @@ CamelCaseLink
foo ~bar
foo bar
| 1|foo |
<table class="user"><tr><td align="right">1</td><td>foo </td></tr></table>
<table class="user"><tr><td align="right">1</td><td align="left">foo </td></tr></table>
EOT
xpath_run_tests(split('\n',<<'EOT'));

View File

@@ -11,7 +11,7 @@
# $Id: creoleaddition.t,v 1.15 2009/02/27 09:56:05 as Exp $
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 29;

View File

@@ -2,7 +2,7 @@
# ====================[ crossbar.t ]====================
# ....................{ INITIALIZATION }....................
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 22;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 1;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 16;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 63;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 60;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 13;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 25;
use utf8;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 4;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 13;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 26;
use utf8;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 9;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 11;
use utf8; # tests contain UTF-8 characters and it matters

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 56;
use utf8;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 4;

View File

@@ -9,7 +9,7 @@
# $Id: emailquote.t,v 1.7 2008/07/12 13:43:48 as Exp $
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 4;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 11;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 41;
use utf8; # tests contain UTF-8 characters and it matters

80
t/exclamation-mark.t Executable file
View File

@@ -0,0 +1,80 @@
# Copyright (C) 2017 Alex Schroeder <alex@gnu.org>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require './t/test.pl';
package OddMuse;
use Test::More tests => 19;
use utf8; # tests contain UTF-8 characters and it matters
xpath_test(update_page('Start', '[[Help!]]'),
'//a[@class="edit"][@title="Click to edit this page"][@href="http://localhost/wiki.pl?action=edit;id=Help!"][text()="?"]');
xpath_test(get_page('action=rc'),
'//strong[text()="Help!"]');
xpath_test(update_page('Help!', 'Test', 'Testing is great!'),
'//h1/a[text()="Help!"]',
'//div[@class="content browse"]/p[text()="Test"]');
xpath_test(get_page('Start'),
'//a[@class="local"][@href="http://localhost/wiki.pl/Help!"][text()="Help!"]');
xpath_test(get_page('action=rc'),
'//strong[text()="Testing is great!"]');
xpath_test(update_page('Start', '[[image:Help!]]'),
'//img[@class="upload"][@alt="Help!"][@src="http://localhost/wiki.pl/download/Help!"]');
xpath_run_tests(split('\n',<<'EOT'));
[http://example.org/ example!]
//a[@class="url http outside"][@href="http://example.org/"][text()="example!"]
EOT
# Test von RSS 3.0
test_page(get_page('action=rc raw=1'), 'title: Help!');
add_module('creole.pl');
# same test as before
xpath_test(get_page('Start'),
'//img[@class="upload"][@alt="Help!"][@src="http://localhost/wiki.pl/download/Help!"]');
# revert and run the previous test as well
xpath_test(update_page('Start', '[[Help!]]'),
'//a[@class="local"][@href="http://localhost/wiki.pl/Help!"][text()="Help!"]');
# Journal test
update_page('2011-11-20 No Testing Today!', 'This is the page itself.');
test_page(update_page('Journal', '<journal>'),
'2011-11-20 No Testing Today!');
# the following was copied from creole.pl
update_page('InterMap', " Ohana http://www.wikiohana.org/\n", 0, 0, 1);
update_page('link!', 'test');
update_page('pic!', 'test');
ReInit();
xpath_run_tests(split('\n',<<'EOT'));
[[link!]]
//a[text()="link!"]
[[link!|Go to my page]]
//a[@class="local"][@href="http://localhost/test.pl/link!"][text()="Go to my page"]
{{pic!}}
//a[@class="image"][@href="http://localhost/test.pl/pic!"][img[@class="upload"][@src="http://localhost/test.pl/download/pic!"][@alt="pic!"]]
[[link!|{{pic!}}]]
//a[@class="image"][@href="http://localhost/test.pl/link!"][img[@class="upload"][@src="http://localhost/test.pl/download/pic!"][@alt="link!"]]
[[link!|{{http://example.com/q?a=1&b=2}}]]
//a[@class="image"][@href="http://localhost/test.pl/link!"][img[@class="url outside"][@src="http://example.com/q?a=1&b=2"][@alt="link!"]]
[[http://example.com/q?a=1&b=2|{{pic!}}]]
//a[@class="image outside"][@href="http://example.com/q?a=1&b=2"][img[@class="upload"][@src="http://localhost/test.pl/download/pic!"][@alt="http://example.com/q?a=1&b=2"]]
[[link!|{{pic!|text!}}]]
//a[@class="image"][@href="http://localhost/test.pl/link!"][img[@class="upload"][@src="http://localhost/test.pl/download/pic!"][@alt="text!"]]
EOT

View File

@@ -9,7 +9,7 @@
# $Id: fieldlist.t,v 1.1 2008/02/23 17:12:12 weakish Exp $
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 9;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 18;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 22;
use utf8; # tests contain UTF-8 characters and it matters

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 3;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 16;
use utf8; # test data is UTF-8 and it matters

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 3;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use utf8;
use Test::More tests => 2;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 9;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 7;
use utf8;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 16;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 13;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 37;

2
t/hr.t
View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 8;

View File

@@ -9,7 +9,7 @@
# $Id: htmlcomment.t,v 1.1 2008/02/22 09:24:27 weakish Exp $
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 6;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 33;
use utf8; # tests contain UTF-8 characters and it matters

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 6;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 5;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 48;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 51;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 8;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 35;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 5;
use utf8; # tests contain UTF-8 characters and it matters

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use utf8;
use Test::More tests => 17;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 2;

View File

@@ -12,7 +12,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 60;
use utf8;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 3;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 6;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 19;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 17;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 18;

View File

@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 20;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 1;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 9;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use utf8; # tests contain UTF-8 characters and it matters
use Test::More tests => 52;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 10;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 60;

View File

@@ -14,11 +14,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 47;
use Test::More tests => 52;
add_module('markdown-rule.pl');
add_module('bbcode.pl');
# ApplyRules strips trailing newlines, so write tests accordingly.
run_tests(split(/\n/,<<'EOT'));
@@ -54,14 +55,22 @@ this is <strong>bold</strong>
<strong>bold</strong>
*italic*
<em>italic</em>
*italic* less.
<em>italic</em> less.
*italic.* more.
<em>italic.</em> more.
__underline__
<em style="font-style: normal; text-decoration: underline">underline</em>
_underline_
<em style="font-style: normal; text-decoration: underline">underline</em>
_italic._ more.
<em style="font-style: normal; text-decoration: underline">italic.</em> more.
//italic//
<em>italic</em>
/italic/
<em>italic</em>
/italic./ more.
<em>italic.</em> more.
foo\nbar
foo bar
foo\n===\nbar
@@ -115,8 +124,10 @@ foo <del>bar</del>
EOT
xpath_run_tests(split('\n',<<'EOT'));
[an example](http://example.com/ "Title")
//a[@class="url http"][@href="http://example.com/"][@title="Title"][text()="an example"]
[example](http://example.com/)
//a[@class="url http"][@href="http://example.com/"][text()="example"]
[an example](http://example.com/)
//a[@class="url http"][@href="http://example.com/"][text()="an example"]
[an example](http://example.com/ "Title")
//a[@class="url http"][@href="http://example.com/"][@title="Title"][text()="an example"]
EOT

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 5;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 59;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 3;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 5;

View File

@@ -19,7 +19,7 @@ use v5.10;
use utf8;
package OddMuse;
require 't/test.pl';
require './t/test.pl';
use Test::More tests => 29;
use File::Basename;
use Pod::Strip;

View File

@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
require 't/test.pl';
require './t/test.pl';
package OddMuse;
use Test::More tests => 15;

View File

@@ -18,52 +18,53 @@ use Test::More;
use Test::Mojo;
use utf8; # tests contain UTF-8 characters and it matters
require 't/test.pl';
require './t/test.pl';
add_module('namespaces.pl');
# Sadly, this appears to be required because path_info is already decoded!
AppendStringToFile($ConfigFile, <<'EOF');
sub GetNamespace {
my $ns = GetParam('ns', '');
if (not $ns and $UsePathInfo) {
my $path_info = $q->path_info();
# make sure ordinary page names are not matched!
if ($path_info =~ m|^/($InterSitePattern)(/.*)?|
and ($2 or $q->keywords or NamespaceRequiredByParameter())) {
$ns = $1;
}
}
ReportError(Ts('%s is not a legal name for a namespace', $ns))
if $ns and $ns !~ m/^($InterSitePattern)$/;
return $ns;
}
# Before Perl 5.26, this appeared to be required because path_info is already
# decoded!
# AppendStringToFile($ConfigFile, <<'EOF');
# sub GetNamespace {
# my $ns = GetParam('ns', '');
# if (not $ns and $UsePathInfo) {
# my $path_info = $q->path_info();
# # make sure ordinary page names are not matched!
# if ($path_info =~ m|^/($InterSitePattern)(/.*)?|
# and ($2 or $q->keywords or NamespaceRequiredByParameter())) {
# $ns = $1;
# }
# }
# ReportError(Ts('%s is not a legal name for a namespace', $ns))
# if $ns and $ns !~ m/^($InterSitePattern)$/;
# return $ns;
# }
*GetId = \&NamespacesNewGetId;
# *GetId = \&NamespacesNewGetId;
sub NamespacesNewGetId {
my $id = UnquoteHtml(GetParam('id', GetParam('title', ''))); # id=x or title=x -> x
if (not $id and $q->keywords) {
$id = decode_utf8(join('_', $q->keywords)); # script?p+q -> p_q
}
if ($UsePathInfo and $q->path_info) {
my @path = split(/\//, $q->path_info);
$id ||= pop(@path); # script/p/q -> q
foreach my $p (@path) {
# https://campaignwiki.org/wiki/F%c3%bcnfWinde/G%c3%b6tter means that
# FünfWinde and Götter are both treated correctly.
SetParam($p, 1); # script/p/q -> p=1
}
}
# http://example.org/cgi-bin/wiki.pl?action=browse;ns=Test;id=Test means NamespaceCurrent=Test and id=Test
# http://example.org/cgi-bin/wiki.pl/Test/Test means NamespaceCurrent=Test and id=Test
# In this case GetId() will have set the parameter Test to 1.
# http://example.org/cgi-bin/wiki.pl/Test?rollback-1234=foo
# This doesn't set the Test parameter.
return if $id and $UsePathInfo and $id eq $NamespaceCurrent and not GetParam($id) and not GetParam('ns');
return $id;
}
EOF
# sub NamespacesNewGetId {
# my $id = UnquoteHtml(GetParam('id', GetParam('title', ''))); # id=x or title=x -> x
# if (not $id and $q->keywords) {
# $id = decode_utf8(join('_', $q->keywords)); # script?p+q -> p_q
# }
# if ($UsePathInfo and $q->path_info) {
# my @path = split(/\//, $q->path_info);
# $id ||= pop(@path); # script/p/q -> q
# foreach my $p (@path) {
# # https://campaignwiki.org/wiki/F%c3%bcnfWinde/G%c3%b6tter means that
# # FünfWinde and Götter are both treated correctly.
# SetParam($p, 1); # script/p/q -> p=1
# }
# }
# # http://example.org/cgi-bin/wiki.pl?action=browse;ns=Test;id=Test means NamespaceCurrent=Test and id=Test
# # http://example.org/cgi-bin/wiki.pl/Test/Test means NamespaceCurrent=Test and id=Test
# # In this case GetId() will have set the parameter Test to 1.
# # http://example.org/cgi-bin/wiki.pl/Test?rollback-1234=foo
# # This doesn't set the Test parameter.
# return if $id and $UsePathInfo and $id eq $NamespaceCurrent and not GetParam($id) and not GetParam('ns');
# return $id;
# }
# EOF
start_mojolicious_server();
sleep(1);

View File

@@ -17,7 +17,7 @@ package OddMuse;
use Test::More;
use Test::Mojo;
require 't/test.pl';
require './t/test.pl';
start_mojolicious_server();
sleep(1);

Some files were not shown because too many files have changed in this diff Show More