From 8fbe201bb379e46c4285be5c07eb1247a8639d96 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Mon, 21 Jul 2008 13:50:59 -0400 Subject: Fix one missed instance of a directive without [[! (it was committed after I branched) --- doc/todo/online_configuration.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/todo/online_configuration.mdwn b/doc/todo/online_configuration.mdwn index db3b41a71..94c4c66f8 100644 --- a/doc/todo/online_configuration.mdwn +++ b/doc/todo/online_configuration.mdwn @@ -63,4 +63,4 @@ the web browser. The `rebuild` fields would be set to 1 for values that require a wiki rebuild when changed, and to 0 for values that only need the wrappers to be refreshed. -[[tag wishlist]] +[[!tag wishlist]] -- cgit v1.2.3 From 652beaf48c64d5dd10cb0e0702f1fb284c96177a Mon Sep 17 00:00:00 2001 From: Mathias Date: Mon, 21 Jul 2008 16:04:17 -0400 Subject: --- ..._blog_items_when_filename_contains_a_colon.mdwn | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn index 608d09b74..11463d770 100644 --- a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn +++ b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn @@ -22,4 +22,34 @@ In any case, `htmlscrubber` should get a new regexp, courtesy of dato: [Commit/patch be0b4f60](http://git.madduck.net/v/code/ikiwiki.git?a=commit;h=be0b4f603f918444b906e42825908ddac78b7073) fixes this. -[[done]] + +**July 21 2008:** I update this bug report as it still seems to be an issue: E.g. when creating a subpage whose name contains +a colon by inserting an appropriate wikilink in the parent page: the new page can be created using that link, but afterwards +there won't be a link to this page. Like madduck said above it seems to be htmlscrubber removing this link. However everything +works fine if the same page is being linked to from another subpage because in that case the resulting link starts with `../`. + +At the moment I see two possible solutions: + +1. let all relative links at least start with `./`. I haven't tested this. + +2. Escape the colon in page titles. I created the following patch which worked for me: + + --- IkiWiki.pm.2.53-save 2008-07-08 15:56:38.000000000 +0200 + +++ IkiWiki.pm 2008-07-21 20:41:35.000000000 +0200 + @@ -477,13 +477,13 @@ + + sub titlepage ($) { #{{{ + my $title=shift; + - $title=~s/([^-[:alnum:]:+\/.])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg; + + $title=~s/([^-[:alnum:]+\/.])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg; + return $title; + } #}}} + + sub linkpage ($) { #{{{ + my $link=shift; + - $link=~s/([^-[:alnum:]:+\/._])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg; + + $link=~s/([^-[:alnum:]+\/._])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg; + return $link; + } #}}} + +What do you think about that? Does the patch have any side-effects I didn't see? -- cgit v1.2.3 From 09a5cdbb3401cdcb17f3d2993912a8f0ea8d23b2 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 21 Jul 2008 22:01:11 +0100 Subject: Don't prepend tagbase to tags if they start with "./" or "/". That syntax made little sense previously, and this allows sites to put "most" of their tags under $tagbase. --- IkiWiki/Plugin/tag.pm | 3 ++- doc/plugins/tag.mdwn | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index f0e3c223c..b0a0e53be 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -25,7 +25,8 @@ sub getopt () { #{{{ sub tagpage ($) { #{{{ my $tag=shift; - if (exists $config{tagbase} && + if ($tag !~ m{^\.?/} && + exists $config{tagbase} && defined $config{tagbase}) { $tag=$config{tagbase}."/".$tag; } diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn index a2f0c7e57..c197ae53f 100644 --- a/doc/plugins/tag.mdwn +++ b/doc/plugins/tag.mdwn @@ -24,6 +24,12 @@ tags/tech, tags/life, and tags/linux. This is a useful way to avoid having to write the full path to tags, if you want to keep them grouped together out of the way. +If you want to override the tagbase for a particular tag, you can use +something like this: + + \[[!tag ./foo]] + \[[!taglink /foo]] + [[!if test="enabled(tag)" then=""" This wiki has the tag plugin enabled, so you'll see a note below that this page is tagged with the "tags" tag. -- cgit v1.2.3 From b884cbd00ffe5f789c21ef7d563603512d141c67 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Jul 2008 17:12:17 -0400 Subject: response --- doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc') diff --git a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn index 11463d770..78f6d6cac 100644 --- a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn +++ b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn @@ -53,3 +53,9 @@ At the moment I see two possible solutions: } #}}} What do you think about that? Does the patch have any side-effects I didn't see? + +> What version of ikiwiki are you seeing it with? I fixed another +> colon-bug in version 2.53; you'd need to rebuild any affected wikis to +> get the fix. The relevant code is in `beautify_urlpath`, where it adds +> "./" in front of every relative url. An example of it working in this +> very wiki is a link to [[colon:problem]] --[[Joey]] -- cgit v1.2.3 From 9187e53575be1c9a6022bbac296941bbbfa8becc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Jul 2008 17:14:43 -0400 Subject: test --- doc/bugs/colon:problem/discussion.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/bugs/colon:problem/discussion.mdwn (limited to 'doc') diff --git a/doc/bugs/colon:problem/discussion.mdwn b/doc/bugs/colon:problem/discussion.mdwn new file mode 100644 index 000000000..b8547ea63 --- /dev/null +++ b/doc/bugs/colon:problem/discussion.mdwn @@ -0,0 +1 @@ +testing a link to [[colon::problem]] -- cgit v1.2.3 From 9a8b0744a37553727083cc5a6c5faaa244bde6ef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Jul 2008 17:15:12 -0400 Subject: typo --- doc/bugs/colon:problem/discussion.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/bugs/colon:problem/discussion.mdwn b/doc/bugs/colon:problem/discussion.mdwn index b8547ea63..e2856ed95 100644 --- a/doc/bugs/colon:problem/discussion.mdwn +++ b/doc/bugs/colon:problem/discussion.mdwn @@ -1 +1 @@ -testing a link to [[colon::problem]] +testing a link to [[colon:problem]] -- cgit v1.2.3 From fcbdc3f05b668cba559c8d55a04cf0cf208c37a2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Jul 2008 17:16:10 -0400 Subject: test --- doc/bugs.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn index f634b6e78..f5e166275 100644 --- a/doc/bugs.mdwn +++ b/doc/bugs.mdwn @@ -7,3 +7,5 @@ Also see the [Debian bugs](http://bugs.debian.org/ikiwiki). !link(patch) and !link(bugs/done) and !bugs/*/*" feedpages="created_after(bugs/no_commit_mails_for_new_pages)" actions=yes rootpage="bugs" postformtext="Add a new bug titled:" show=0]] + +test: [[colon:problem]] -- cgit v1.2.3 From c323a51efb3b43b8931c12f66e6ae142f1eb20ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Jul 2008 17:18:14 -0400 Subject: remove test --- doc/bugs.mdwn | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc') diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn index f5e166275..f634b6e78 100644 --- a/doc/bugs.mdwn +++ b/doc/bugs.mdwn @@ -7,5 +7,3 @@ Also see the [Debian bugs](http://bugs.debian.org/ikiwiki). !link(patch) and !link(bugs/done) and !bugs/*/*" feedpages="created_after(bugs/no_commit_mails_for_new_pages)" actions=yes rootpage="bugs" postformtext="Add a new bug titled:" show=0]] - -test: [[colon:problem]] -- cgit v1.2.3 From c2ffd205f3301a9fe6b5949a88da770899642589 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Jul 2008 17:26:54 -0400 Subject: Really fix bug with links to pages with names containing colons Previous fix mised a few cases. --- IkiWiki.pm | 2 +- debian/changelog | 2 ++ .../No_link_for_blog_items_when_filename_contains_a_colon.mdwn | 9 ++++----- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/IkiWiki.pm b/IkiWiki.pm index 063cef8e0..c14124f79 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -538,7 +538,7 @@ sub beautify_urlpath ($) { #{{{ # Ensure url is not an empty link, and # if it's relative, make that explicit to avoid colon confusion. - if ($url !~ /\//) { + if ($url !~ /^\//) { $url="./$url"; } diff --git a/debian/changelog b/debian/changelog index a54d797bd..86a770357 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ ikiwiki (2.55) UNRELEASED; urgency=low * editpage: Don't show attachments link when attachments are disabled. * tag: Allow tagbase to be overridden by starting a tag with "./" or "/". (Simon McVittie) + * Really fix bug with links to pages with names containing colons. + Previous fix mised a few cases. -- Joey Hess Mon, 21 Jul 2008 11:35:46 -0400 diff --git a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn index 78f6d6cac..313c1addd 100644 --- a/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn +++ b/doc/bugs/No_link_for_blog_items_when_filename_contains_a_colon.mdwn @@ -54,8 +54,7 @@ At the moment I see two possible solutions: What do you think about that? Does the patch have any side-effects I didn't see? -> What version of ikiwiki are you seeing it with? I fixed another -> colon-bug in version 2.53; you'd need to rebuild any affected wikis to -> get the fix. The relevant code is in `beautify_urlpath`, where it adds -> "./" in front of every relative url. An example of it working in this -> very wiki is a link to [[colon:problem]] --[[Joey]] +> I almost really fixed this in 2.53, but missed one case. All fixed now +> AFAICS. --[[Joey]] + +[[tag done]] -- cgit v1.2.3