* Replace underscores in shortcut texts with spaces when formatting for

display. This allows using a shortcut like [[wikipedia War_of_1812]],
  which links to the correct remote page, but is displayed nicely.
master
joey 2007-01-28 01:01:33 +00:00
parent e220fbf35d
commit 5a128f3d63
4 changed files with 9 additions and 3 deletions

View File

@ -54,6 +54,7 @@ sub shortcut_expand ($$@) { #{{{
my $encoded_text=$text;
$encoded_text=~s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
$text=~s/_/ /g;
if (defined $desc) {
$desc=~s/\%s/$text/g;
}

5
debian/changelog vendored
View File

@ -14,8 +14,11 @@ ikiwiki (1.41) UNRELEASED; urgency=low
* Always call rcs_update after a commit during a web edit, to work around
the problem described in bugs/svn_fails_to_update. Thanks to Ethan for the
analysis and patch.
* Replace underscores in shortcut texts with spaces when formatting for
display. This allows using a shortcut like [[wikipedia War_of_1812]],
which links to the correct remote page, but is displayed nicely.
-- Joey Hess <joeyh@debian.org> Sat, 27 Jan 2007 19:18:27 -0500
-- Joey Hess <joeyh@debian.org> Sat, 27 Jan 2007 19:59:58 -0500
ikiwiki (1.40) unstable; urgency=low

View File

@ -2,4 +2,6 @@ Writing [[wikipedia Low_frequency_oscillation]] causes the word "frequency"
to show up in italics, since underscores are Markdown for italics. Using
[[wikipedia low frequency oscillation]] works in this case, because Wikipedia
will redirect, but it's hardly clean. Maybe the shortcuts plugin should
run pagetitle() on the text of its link? --Ethan
run pagetitle() on the text of its link? --Ethan
> [[bugs/done]] --[[Joey]]

View File

@ -5,7 +5,7 @@ This plugin allows external links to commonly linked to sites to be made
more easily using shortcuts. Some examples of using shortcuts include:
\[[google foo]]
\[[wikipedia War of 1812]]
\[[wikipedia War_of_1812]]
\[[debbug 12345]]
The available shortcuts are defined on the [[shortcuts]] page in