]> git.wincent.com - wikitext.git/commit
Handle empty (whitespace-only) link targets
authorWincent Colaiuta <win@wincent.com>
Tue, 28 Apr 2009 10:11:57 +0000 (12:11 +0200)
committerWincent Colaiuta <win@wincent.com>
Tue, 28 Apr 2009 10:11:57 +0000 (12:11 +0200)
commitf1583d29efda3ed261f489587605416c9f03d5f9
tree230b504c10f86edc5205227afb548fcd2ae5efc1
parent294b829fa540207f7bba33051f1ed1b6243d286c
Handle empty (whitespace-only) link targets

Previously we accepted buggy input like "[[ ]]", "[[  ]]"
and "[[   |foo]]" and dutifully turned it into empty links
like:

  <a href="/wiki/"></a>

And:

  <a href="/wiki/">foo</a>

It clearly makes no sense for a bad link like "[[  ]]" to
take the user back to the wiki index, so now we spit out
these bad links verbatim to provide feedback to the user
that there's something wrong with their input.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/parser.c
spec/regressions_spec.rb