From: Jeff D. <da...@da...> - 2001-11-11 05:27:21
|
On Sat, 10 Nov 2001 22:24:55 +0100 "Tara Star" <te...@cl...> wrote: > function wtt_bracketlinks($match, &$trfrm) > { > $link = ParseAndLink($match); > if (strstr($link['link'], "</form>")) { > // FIXME: BIG HACK: see note in wtm_plugin. > return "</p>" . $link['link'] . "<p>"; > } > return $link["link"]; > } If you read pgsrc/MagicPhpWikiURLs, you'll see that things like '[phpwiki:TitleSearch?s=()]' gets transformed to a form. The transformation is done by MakeWikiForm and LinkPhpwikiURL which get called from ParseAndLink. I think <form>s are not allowed within <p>s (you probably know better than I about that) --- in any case, I remember that <form>s within <p>s caused problems with CSS handling in certain browsers. (Of course, most bracket links, like [some page] or [http://a.b.com/c] just expand to regular <a>'s.) So the code is there so that if the bracket link expands to a <form> tag, we close the current <p>, spit out the <form>, then open a new <p>, so that no one will be the wiser. It's buggy and ugly. Sorry. But I think the MagicPhpWikiURL forms will be a thing of the past fairly soon, so it's probably not worth worrying about too much. As I said before, at some point I plan on taking another crack at rewriting the transform code. |