forked from github/kensanata.oddmuse
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3cbd8db8b | ||
|
|
90e92c27b8 | ||
|
|
76b433c1da | ||
|
|
b116a0103e | ||
|
|
6a7a0dd24d | ||
|
|
c2366aa36f | ||
|
|
4da50ef125 | ||
|
|
2e0f293dcd | ||
|
|
d0095a36b5 | ||
|
|
1eae7852c4 | ||
|
|
da06278df8 | ||
|
|
bd8f914804 | ||
|
|
51b24309a7 | ||
|
|
60a4572087 | ||
|
|
248af821a7 | ||
|
|
c85e8b84b9 | ||
|
|
e4d159307b | ||
|
|
80a30a9102 | ||
|
|
299b94243d | ||
|
|
b7ab45a3a7 | ||
|
|
9d3deaff0f | ||
|
|
42a1e389a5 | ||
|
|
9883a064f3 | ||
|
|
52617b472d | ||
|
|
764c15e6c0 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.pl linguist-language=Perl
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@
|
||||
.DS_Store
|
||||
wiki.log
|
||||
.prove
|
||||
TAGS
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
49
modules/ditaa.pl
Normal file
@@ -0,0 +1,49 @@
|
||||
#! /usr/bin/perl
|
||||
# Copyright (C) 2015–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('ditaa.pl', 'Ditaa for Diagrams');
|
||||
|
||||
our ($q, $bol, @MyRules, @KnownLocks, $TempDir);
|
||||
|
||||
push (@MyRules, \&DitaaRule);
|
||||
push(@KnownLocks, 'diagram');
|
||||
|
||||
sub DitaaRule {
|
||||
if ($bol && m/\G<diagram(\s+style=".*")?>\n((.*\n)+)<\/diagram>/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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
73
modules/mermaid.pl
Normal 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') =~ /<mermaid>/
|
||||
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\<mermaid\>\n(.+?)\n\<\/mermaid\>/cgs) {
|
||||
return CloseHtmlEnvironments()
|
||||
. '<div class="mermaid">' . UrlDecode($1) . '</div>';
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ sub PermanentAnchorsRule {
|
||||
} else {
|
||||
print $q->span({-class=>'permanentanchor'}, $2);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/all.t
2
t/all.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/atom.t
2
t/atom.t
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/ban.t
2
t/ban.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
13
t/comments.t
13
t/comments.t
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2006–2015 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 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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
10
t/creole.t
10
t/creole.t
@@ -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'));
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# ====================[ crossbar.t ]====================
|
||||
|
||||
# ....................{ INITIALIZATION }....................
|
||||
require 't/test.pl';
|
||||
require './t/test.pl';
|
||||
package OddMuse;
|
||||
use Test::More tests => 22;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/css.t
2
t/css.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/diff.t
2
t/diff.t
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
2
t/edit.t
2
t/edit.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
80
t/exclamation-mark.t
Executable 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
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/find.t
2
t/find.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/git.t
2
t/git.t
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
2
t/hr.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/irc.t
2
t/irc.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
2
t/like.t
2
t/like.t
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/lock.t
2
t/lock.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/mail.t
2
t/mail.t
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
2
t/meta.t
2
t/meta.t
@@ -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;
|
||||
|
||||
2
t/moin.t
2
t/moin.t
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user