Loosen regexp, to allow empty quoted parameters in directives.
parent
068e47aa45
commit
b3c3c42b26
|
@ -1220,7 +1220,7 @@ sub preprocess ($$$;$$) {
|
|||
(?:
|
||||
"""(.*?)""" # 2: triple-quoted value
|
||||
|
|
||||
"([^"]+)" # 3: single-quoted value
|
||||
"([^"]*?)" # 3: single-quoted value
|
||||
|
|
||||
(\S+) # 4: unquoted value
|
||||
)
|
||||
|
@ -1306,7 +1306,7 @@ sub preprocess ($$$;$$) {
|
|||
(?:
|
||||
""".*?""" # triple-quoted value
|
||||
|
|
||||
"[^"]+" # single-quoted value
|
||||
"[^"]*?" # single-quoted value
|
||||
|
|
||||
[^"\s\]]+ # unquoted value
|
||||
)
|
||||
|
@ -1329,7 +1329,7 @@ sub preprocess ($$$;$$) {
|
|||
(?:
|
||||
""".*?""" # triple-quoted value
|
||||
|
|
||||
"[^"]+" # single-quoted value
|
||||
"[^"]*?" # single-quoted value
|
||||
|
|
||||
[^"\s\]]+ # unquoted value
|
||||
)
|
||||
|
|
|
@ -3,6 +3,7 @@ ikiwiki (3.20100213) UNRELEASED; urgency=low
|
|||
* comments: Display number of comments in comment action link.
|
||||
* Rebuild wikis on upgrade to this version to get the comment counts
|
||||
added to existing pages.
|
||||
* Loosen regexp, to allow empty quoted parameters in directives.
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Sun, 14 Feb 2010 17:02:10 -0500
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/perl
|
||||
use warnings;
|
||||
use strict;
|
||||
use Test::More tests => 21;
|
||||
use Test::More tests => 31;
|
||||
|
||||
BEGIN { use_ok("IkiWiki"); }
|
||||
|
||||
|
@ -26,6 +26,16 @@ is(IkiWiki::preprocess("foo", "foo", "[[foo ]]", 0, 0), "foo()", "simple");
|
|||
is(IkiWiki::preprocess("foo", "foo", "[[!foo ]]", 0, 0), "foo()", "prefixed");
|
||||
is(IkiWiki::preprocess("foo", "foo", "[[!foo]]", 0, 0), "[[!foo]]", "prefixed, no space");
|
||||
is(IkiWiki::preprocess("foo", "foo", "[[foo a=1]]", 0, 0), "foo(a => 1)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="1"]]}, 0, 0), "foo(a => 1)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""1"""]]}, 0, 0), "foo(a => 1)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a=""]]}, 0, 0), "foo(a)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="" b="1"]]}, 0, 0), "foo(a, b => 1)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a=""""""]]}, 0, 0), "foo(a)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""""" b="1"]]}, 0, 0), "foo(a, b => 1)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""""" b="""1"""]]}, 0, 0), "foo(a, b => 1)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""""" b=""""""]]}, 0, 0), "foo(a, b)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="" b=""""""]]}, 0, 0), "foo(a, b)");
|
||||
is(IkiWiki::preprocess("foo", "foo", q{[[foo a="" b="""1"""]]}, 0, 0), "foo(a, b => 1)");
|
||||
is(IkiWiki::preprocess("foo", "foo", "[[foo a=\"1 2 3 4\"]]", 0, 0), "foo(a => 1 2 3 4)");
|
||||
is(IkiWiki::preprocess("foo", "foo", "[[foo ]] then [[foo a=2]]", 0, 0),
|
||||
"foo() then foo(a => 2)");
|
||||
|
|
Loading…
Reference in New Issue