Fix links generated by preprocessor directives when previewing.
authorJoey Hess <joey@kodama.kitenet.net>
Sun, 24 Feb 2008 21:37:11 +0000 (16:37 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 24 Feb 2008 21:37:11 +0000 (16:37 -0500)
As was already done for linkfication, links generated in a prevew page
are relative to the top of the wiki, so it has to be told that the destpage
is there.

I was using "" to indicate this, but that may confuse some preprocessor
plugins, which treat parameters with an empry value specially (sparkline is one
such). Instead, use "/", which is more accurate anyway and works just as well.

IkiWiki/CGI.pm
debian/changelog
po/ikiwiki.pot

index cfb2c0b1d8e39447581d0fb16606c8ff3fac7243..87cb9c3f3f12c637005cc06ecbbc04b18c5736c5 100644 (file)
@@ -354,9 +354,9 @@ sub cgi_editpage ($$) { #{{{
                });
                $form->tmpl_param("page_preview",
                        htmlize($page, $type,
                });
                $form->tmpl_param("page_preview",
                        htmlize($page, $type,
-                       linkify($page, "",
-                       preprocess($page, $page,
-                       filter($page, $page, $content), 0, 1))));
+                       linkify($page, "/",
+                       preprocess($page, "/",
+                       filter($page, "/", $content), 0, 1))));
                # previewing may have created files on disk
                saveindex();
        }
                # previewing may have created files on disk
                saveindex();
        }
index 093ca0f6cbd3bd9ad489a3cb6e855c00d995ac12..f0ca4c75459945cf39498ba3ce9cfe82a9d3a9fe 100644 (file)
@@ -46,6 +46,7 @@ ikiwiki (2.40) UNRELEASED; urgency=low
     always available. So it was just removed.
   * Disable taint checking for all builds as people keep complaining about it,
     and since all versions of perl seem to be hopelessly broken.
     always available. So it was just removed.
   * Disable taint checking for all builds as people keep complaining about it,
     and since all versions of perl seem to be hopelessly broken.
+  * Fix links generated by preprocessor directives when previewing.
 
  -- Josh Triplett <josh@freedesktop.org>  Sun, 10 Feb 2008 13:18:58 -0800
 
 
  -- Josh Triplett <josh@freedesktop.org>  Sun, 10 Feb 2008 13:18:58 -0800
 
index 1ccb583a74b2bc7cc8db90a94844375aa85eedfa..8be9e2734c37a37ec788e5fe9dc533e5e0e36f36 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-02-24 15:37-0500\n"
+"POT-Creation-Date: 2008-02-24 16:02-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"