]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Allow preprocessor directives to span multiple lines, both to make
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 23 Aug 2006 03:25:40 +0000 (03:25 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 23 Aug 2006 03:25:40 +0000 (03:25 +0000)
  long ones with lots of values easier to write, and to allow for ones with
  multi-line quoted values.

IkiWiki.pm
IkiWiki/Render.pm
basewiki/preprocessordirective.mdwn
debian/changelog

index 9556d6ef7732bba49e180f14323ddc14141bbe48..b9ae74f854dab240c5e563be920d9947bad48f23 100644 (file)
@@ -18,7 +18,6 @@ use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase
 sub defaultconfig () { #{{{
        wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$)},
        wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/,
-       wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]*)\]\]/,
        wiki_file_regexp => qr/(^[-[:alnum:]_.:\/+]+$)/,
        verbose => 0,
        syslog => 0,
index ddd14692230a749b0cee57b6396279e4f236e9bd..8657dc3807a5784a6be50c38b613a4d0f4999ad5 100644 (file)
@@ -123,7 +123,7 @@ sub preprocess ($$$;$) { #{{{
                }
        };
        
-       $content =~ s{(\\?)$config{wiki_processor_regexp}}{$handle->($1, $2, $3)}eg;
+       $content =~ s{(\\?)\[\[(\w+)\s+((?:(?:\w+=)?(?:"[^"]+"|[^\s\]]+)\s*)*)\]\]}{$handle->($1, $2, $3)}eg;
        return $content;
 } #}}}
 
index 2d84cfb97beda43f9049e8e4ba4ee5db7ee53d93..31731af66b5aec50781e2cd19323c02304e8b859 100644 (file)
@@ -15,3 +15,16 @@ Note that if a preprocessor directive has no parameters, a space still must
 be put after its name, to avoid confusion with a [[WikiLink]]. For example:
 
        \[[pagecount ]]
+
+A preprocessor directive does not need to all be on one line. Also,
+multiple lines of *quoted* text can be used for a value. Examples:
+
+       \[[directive foo="baldersnatch"
+       bar="supercalifragalisticexpealadocious" baz=11]]
+
+       \[[directive text="
+       1. foo
+       2. bar
+       3. baz
+       more lines
+       "]]
index a4676af79796fa1d39a3a8684cc5299f4cae4be1..ba8b6d4f4c8d819d380c42a821803dc46aa36c81 100644 (file)
@@ -5,8 +5,11 @@ ikiwiki (1.22) UNRELEASED; urgency=low
     new more general variable can be used to link to other things (eg, images)
     from the template, as well as stylesheets.
   * Fix a bug introduced last version to do with nested inlines.
+  * Allow preprocessor directives to span multiple lines, both to make
+    long ones with lots of values easier to write, and to allow for ones with
+    multi-line quoted values.
 
- -- Joey Hess <joeyh@debian.org>  Tue, 22 Aug 2006 12:53:05 -0400
+ -- Joey Hess <joeyh@debian.org>  Tue, 22 Aug 2006 23:09:46 -0400
 
 ikiwiki (1.21) unstable; urgency=low