forked from github/kensanata.oddmuse
Compare commits
10 Commits
namespaces
...
2.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f21f257c1b | ||
|
|
48916943a1 | ||
|
|
3b185e5521 | ||
|
|
612af8f7fb | ||
|
|
dc9131e600 | ||
|
|
99af4d984d | ||
|
|
88f4fe3b89 | ||
|
|
851f2f77e8 | ||
|
|
975e15c9f8 | ||
|
|
d235d6ac47 |
@@ -31,6 +31,7 @@ sub DoJournalRss {
|
||||
local $CollectingJournal = 1;
|
||||
# Fake the result of GetRcLines()
|
||||
local *GetRcLines = \&JournalRssGetRcLines;
|
||||
local *RcSelfWebsite = \&JournalRssSelfWebsite;
|
||||
local *RcSelfAction = \&JournalRssSelfAction;
|
||||
local *RcPreviousAction = \&JournalRssPreviousAction;
|
||||
local *RcLastAction = \&JournalRssLastAction;
|
||||
@@ -55,6 +56,15 @@ sub JournalRssParameters {
|
||||
return $more;
|
||||
}
|
||||
|
||||
sub JournalRssSelfWebsite {
|
||||
my $more = '';
|
||||
my $search = GetParam('rcfilteronly', '');
|
||||
$more .= ";search=" . UrlEncode($search) if $search;
|
||||
my $match = GetParam('match', '');
|
||||
$more .= ";match=" . UrlEncode($match) if $match;
|
||||
return $more;
|
||||
}
|
||||
|
||||
sub JournalRssSelfAction {
|
||||
return "action=journal" . JournalRssParameters(qw(offset));
|
||||
}
|
||||
|
||||
@@ -505,9 +505,9 @@ sub MailUnsubscribe {
|
||||
|
||||
=head1 Migrate
|
||||
|
||||
The mailmigrate action will migrate your subscription list from the
|
||||
old format to the new format. This is necessary because these days
|
||||
because the keys and values of the DB_File are URL encoded.
|
||||
The mailmigrate action will migrate your subscription list from the old format
|
||||
to the new format. This is necessary because these days the keys and values of
|
||||
the DB_File are URL encoded.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -203,6 +203,15 @@ sub MarkdownRule {
|
||||
$params{-title} = $title if $title;
|
||||
return $q->a(\%params, $text);
|
||||
}
|
||||
# link: [an example](#foo "Title")
|
||||
elsif (m/\G\[((?:[^]\n]+\n?)+)\]\((#\S)+(\s+"(.+?)")?\)/cg) {
|
||||
my ($text, $url, $title) = ($1, $2, $4);
|
||||
my %params;
|
||||
$params{-href} = $url;
|
||||
$params{-class} = "named-anchor";
|
||||
$params{-title} = $title if $title;
|
||||
return $q->a(\%params, $text);
|
||||
}
|
||||
# setext headers (must come after block quotes)
|
||||
elsif ($bol and m/\G((\s*\n)*(.+?)[ \t]*\n(-+|=+)[ \t]*\n)/cg) {
|
||||
return CloseHtmlEnvironments()
|
||||
|
||||
@@ -675,10 +675,10 @@ sub gemini_text {
|
||||
$block =~ s/\[\[tag:([^]|]+)\]\]/push(@links, $self->gemini_link("tag\/$1", $1)); $1/ge;
|
||||
$block =~ s/\[\[tag:([^]|]+)\|([^\]|]+)\]\]/push(@links, $self->gemini_link("tag\/$1", $2)); $2/ge;
|
||||
$block =~ s/<journal search tag:(\S+)>\n*/push(@links, $self->gemini_link("tag\/$1", "Explore the $1 tag")); ""/ge;
|
||||
$block =~ s/\[\[image:([^]|]+)\]\]/push(@links, $self->gemini_link($1, "$1 (image)")); "$1"/ge;
|
||||
$block =~ s/\[\[image:([^]|]+)\|([^\]|]+)\]\]/push(@links, $self->gemini_link($1, "$2 (image)")); "$2"/ge;
|
||||
$block =~ s/\[\[image:([^]|]+)\|([^\]|]*)\|([^\]|]+)\]\]/push(@links, $self->gemini_link($1, "$2 (image)"), $self->gemini_link($3, "$2 (follow-up)")); "$2"/ge;
|
||||
$block =~ s/\[\[image:([^]|]+)\|([^\]|]*)\|([^\]|]*)\|([^\]|]+)\]\]/push(@links, $self->gemini_link($1, "$2 (image)"), $self->gemini_link($3, "$4 (follow-up)")); "$2"/ge;
|
||||
$block =~ s/\[\[image(?:\/right)?:([^]|]+)\]\]/push(@links, $self->gemini_link($1, "$1 (image)")); "$1"/ge;
|
||||
$block =~ s/\[\[image(?:\/right)?:([^]|]+)\|([^\]|]+)\]\]/push(@links, $self->gemini_link($1, "$2 (image)")); "$2"/ge;
|
||||
$block =~ s/\[\[image(?:\/right)?:([^]|]+)\|([^\]|]*)\|([^\]|]+)\]\]/push(@links, $self->gemini_link($1, "$2 (image)"), $self->gemini_link($3, "$2 (follow-up)")); "$2"/ge;
|
||||
$block =~ s/\[\[image(?:\/right)?:([^]|]+)\|([^\]|]*)\|([^\]|]*)\|([^\]|]+)\]\]/push(@links, $self->gemini_link($1, "$2 (image)"), $self->gemini_link($3, "$4 (follow-up)")); "$2"/ge;
|
||||
$block =~ s/\[\[$FreeLinkPattern\|([^\]|]+)\]\]/push(@links, $self->gemini_link($1, $2)); $2/ge;
|
||||
$block =~ s/\[\[$FreeLinkPattern\]\]/push(@links, $self->gemini_link($1)); $1/ge;
|
||||
$block =~ s/\[color=([^]]+)\]/color($1)/ge;
|
||||
|
||||
@@ -129,8 +129,8 @@ test_page(update_page('Testing', 'This is spam.'), 'This page does not exist');
|
||||
test_page(update_page('Spam', 'Trying again.'), 'This page does not exist');
|
||||
test_page(get_page('action=translate id=Spam target=Harmless translation=en'),
|
||||
'Edit Denied',
|
||||
'Regular expression "spam" matched on this page');
|
||||
'Regular expression "spam" matched "Spam" on this page');
|
||||
test_page(get_page('Spam'), 'This page does not exist');
|
||||
test_page(get_page('action=translate id=Harmless target=Spam translation=en'),
|
||||
'Edit Denied',
|
||||
'Regular expression "spam" matched on this page');
|
||||
'Regular expression "spam" matched "Spam" on this page');
|
||||
|
||||
46
wiki.pl
46
wiki.pl
@@ -514,7 +514,7 @@ sub ApplyRules {
|
||||
Clean(CloseHtmlEnvironments() . AddHtmlEnvironment('p')); # another one like this further up
|
||||
} elsif (m/\G&([A-Za-z]+|#[0-9]+|#x[A-Za-f0-9]+);/cg) { # entity references
|
||||
Clean("&$1;");
|
||||
} elsif (m/\G\s+/cg) {
|
||||
} elsif (m/\G[ \t\r\n]+/cg) { # don't use \s because we want to honor NO-BREAK SPACE etc
|
||||
Clean(' ');
|
||||
} elsif (m/\G([A-Za-z\x{0080}-\x{fffd}]+([ \t]+[a-z\x{0080}-\x{fffd}]+)*[ \t]+)/cg
|
||||
or m/\G([A-Za-z\x{0080}-\x{fffd}]+)/cg or m/\G(\S)/cg) {
|
||||
@@ -1313,7 +1313,7 @@ sub GetId {
|
||||
SetParam($p, 1); # script/p/q -> p=1
|
||||
}
|
||||
}
|
||||
return $id;
|
||||
return FreeToNormal($id);
|
||||
}
|
||||
|
||||
sub DoBrowseRequest {
|
||||
@@ -1712,6 +1712,11 @@ sub RcOtherParameters {
|
||||
return $more;
|
||||
}
|
||||
|
||||
sub RcSelfWebsite {
|
||||
my $action = 'rc';
|
||||
return "action=$action" . RcOtherParameters(qw(from upto days));
|
||||
}
|
||||
|
||||
sub RcSelfAction {
|
||||
my $action = GetParam('action', 'rc');
|
||||
return "action=$action" . RcOtherParameters(qw(from upto days));
|
||||
@@ -1898,7 +1903,7 @@ sub GetRcRss {
|
||||
};
|
||||
my $title = QuoteHtml($SiteName) . ': ' . GetParam('title', QuoteHtml(NormalToFree($HomePage)));
|
||||
$rss .= "<title>$title</title>\n";
|
||||
$rss .= "<link>$ScriptName?" . RcSelfAction() . "</link>\n";
|
||||
$rss .= "<link>$ScriptName?" . RcSelfWebsite() . "</link>\n";
|
||||
$rss .= qq{<atom:link href="$ScriptName?} . RcSelfAction() . qq{" rel="self" type="application/rss+xml" />\n};
|
||||
$rss .= qq{<atom:link href="$ScriptName?} . RcPreviousAction() . qq{" rel="previous" type="application/rss+xml" />\n};
|
||||
$rss .= qq{<atom:link href="$ScriptName?} . RcLastAction() . qq{" rel="last" type="application/rss+xml" />\n};
|
||||
@@ -1918,7 +1923,7 @@ sub GetRcRss {
|
||||
$rss .= "<image>\n";
|
||||
$rss .= "<url>$RssImageUrl</url>\n";
|
||||
$rss .= "<title>$title</title>\n"; # the same as the channel
|
||||
$rss .= "<link>$ScriptName?" . RcSelfAction() . "</link>\n"; # the same as the channel
|
||||
$rss .= "<link>$ScriptName?" . RcSelfWebsite() . "</link>\n"; # the same as the channel
|
||||
$rss .= "</image>\n";
|
||||
}
|
||||
my $limit = GetParam("rsslimit", 15); # Only take the first 15 entries
|
||||
@@ -2552,23 +2557,30 @@ sub GetFormStart {
|
||||
}
|
||||
|
||||
sub GetSearchForm {
|
||||
my $html = GetFormStart(undef, 'get', 'search') . $q->start_p;
|
||||
$html .= $q->label({-for=>'search'}, T('Search:')) . ' '
|
||||
. $q->textfield(-name=>'search', -id=>'search', -size=>15, -accesskey=>T('f')) . ' ';
|
||||
if (GetParam('search') ne '' and UserIsAdmin()) { # see DoBrowseRequest
|
||||
$html .= $q->label({-for=>'replace'}, T('Replace:')) . ' '
|
||||
. $q->textfield(-name=>'replace', -id=>'replace', -size=>20) . ' '
|
||||
. $q->label({-for=>'delete', -title=>'If you want to replace matches with the empty string'}, T('Delete')) . ' '
|
||||
. $q->input({-type=>'checkbox', -name=>'delete'})
|
||||
. $q->submit('preview', T('Preview'));
|
||||
my $html = GetFormStart(undef, 'get', 'search');
|
||||
my $replacing = (GetParam('search') ne '' and UserIsAdmin());
|
||||
$html .= $q->start_p({-class => ($replacing ? 'replace' : 'search')});
|
||||
$html .= $q->span({-class=>'search'},
|
||||
$q->label({-for=>'search'}, T('Search:')) . ' '
|
||||
. $q->textfield(-name=>'search', -id=>'search', -size=>15, -accesskey=>T('f'))) . ' ';
|
||||
if ($replacing) { # see DoBrowseRequest
|
||||
$html .= $q->span({-class=>'replace'},
|
||||
$q->label({-for=>'replace'}, T('Replace:')) . ' '
|
||||
. $q->textfield(-name=>'replace', -id=>'replace', -size=>20)) . ' '
|
||||
. $q->span({-class=>'delete'},
|
||||
$q->label({-for=>'delete', -title=>'If you want to replace matches with the empty string'}, T('Delete')) . ' '
|
||||
. $q->input({-type=>'checkbox', -name=>'delete'})) . ' '
|
||||
. $q->submit('preview', T('Preview')) . ' ';
|
||||
}
|
||||
if (GetParam('matchingpages', $MatchingPages)) {
|
||||
$html .= $q->label({-for=>'matchingpage'}, T('Filter:')) . ' '
|
||||
. $q->textfield(-name=>'match', -id=>'matchingpage', -size=>15) . ' ';
|
||||
$html .= $q->span({-class=>'match'},
|
||||
$q->label({-for=>'matchingpage'}, T('Filter:')) . ' '
|
||||
. $q->textfield(-name=>'match', -id=>'matchingpage', -size=>15)) . ' ';
|
||||
}
|
||||
if (%Languages) {
|
||||
$html .= $q->label({-for=>'searchlang'}, T('Language:')) . ' '
|
||||
. $q->textfield(-name=>'lang', -id=>'searchlang', -size=>5, -default=>GetParam('lang', '')) . ' ';
|
||||
$html .= $q->span({-class=>'lang'},
|
||||
$q->label({-for=>'searchlang'}, T('Language:')) . ' '
|
||||
. $q->textfield(-name=>'lang', -id=>'searchlang', -size=>5, -default=>GetParam('lang', ''))) . ' ';
|
||||
}
|
||||
$html .= $q->submit('dosearch', T('Go!')) . $q->end_p . $q->end_form;
|
||||
return $html;
|
||||
|
||||
Reference in New Issue
Block a user