aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/editpage.pm20
-rw-r--r--IkiWiki/Plugin/graphviz.pm1
-rw-r--r--IkiWiki/Plugin/link.pm15
3 files changed, 29 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm
index d3c695935..d15607990 100644
--- a/IkiWiki/Plugin/editpage.pm
+++ b/IkiWiki/Plugin/editpage.pm
@@ -64,7 +64,8 @@ sub cgi_editpage ($$) {
decode_cgi_utf8($q);
- my @fields=qw(do rcsinfo subpage from page type editcontent editmessage);
+ my @fields=qw(do rcsinfo subpage from page type editcontent
+ editmessage subscribe);
my @buttons=("Save Page", "Preview", "Cancel");
eval q{use CGI::FormBuilder};
error($@) if $@;
@@ -157,6 +158,17 @@ sub cgi_editpage ($$) {
noimageinline => 1,
linktext => "FormattingHelp"));
+ my $cansubscribe=IkiWiki::Plugin::notifyemail->can("subscribe")
+ && IkiWiki::Plugin::comments->can("import")
+ && defined $session->param('name');
+ if ($cansubscribe) {
+ $form->field(name => "subscribe", type => "checkbox",
+ options => [gettext("email comments to me")]);
+ }
+ else {
+ $form->field(name => "subscribe", type => 'hidden');
+ }
+
my $previewing=0;
if ($form->submitted eq "Cancel") {
if ($form->field("do") eq "create" && defined $from) {
@@ -448,6 +460,12 @@ sub cgi_editpage ($$) {
# caches and get the most recent version of the page.
redirect($q, $baseurl."?updated");
}
+
+ if ($cansubscribe && length $form->field("subscribe")) {
+ my $subspec="comment($page)";
+ IkiWiki::Plugin::notifyemail::subscribe(
+ $session->param('name'), $subspec);
+ }
}
exit;
diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm
index b9f997e04..d4018edaa 100644
--- a/IkiWiki/Plugin/graphviz.pm
+++ b/IkiWiki/Plugin/graphviz.pm
@@ -132,6 +132,7 @@ sub graph (@) {
}, "text");
$p->parse($src);
$p->eof;
+ $s=~s/\[ href= \]//g; # handle self-links
$params{src}=$s;
}
else {
diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm
index ef01f1107..1ba28eafd 100644
--- a/IkiWiki/Plugin/link.pm
+++ b/IkiWiki/Plugin/link.pm
@@ -144,9 +144,9 @@ sub renamepage (@) {
my $old=$params{oldpage};
my $new=$params{newpage};
- $params{content} =~ s{(?<!\\)$link_regexp}{
- if (! is_externallink($page, $2, $3)) {
- my $linktext=$2;
+ $params{content} =~ s{(?<!\\)($link_regexp)}{
+ if (! is_externallink($page, $3, $4)) {
+ my $linktext=$3;
my $link=$linktext;
if (bestlink($page, linkpage($linktext)) eq $old) {
$link=pagetitle($new, 1);
@@ -161,9 +161,12 @@ sub renamepage (@) {
$link="/$link";
}
}
- defined $1
- ? ( "[[$1|$link".($3 ? "#$3" : "")."]]" )
- : ( "[[$link". ($3 ? "#$3" : "")."]]" )
+ defined $2
+ ? ( "[[$2|$link".($4 ? "#$4" : "")."]]" )
+ : ( "[[$link". ($4 ? "#$4" : "")."]]" )
+ }
+ else {
+ $1
}
}eg;