Home » Text » Text_Wiki » Bug #6292
headings and hr are incorrectly nested in p-tags
Details
| Submitted | 2005-12-19 20:28 UTC |
|---|---|
| From | wolfgang dot illmeyer at gmx dot net |
| Assigned | justinpatrin |
| Status | Closed |
| Package | Text_Wiki |
| PHP Version | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-12-19 20:28 UTC] wolfgang dot illmeyer at gmx dot net
Description:
------------
There's an error in the XHTML Renderer concerning the placement of <p>-Tags when used with headings or <hr />. Headings and <hr /> are not allowed to be nested in <p>-tags. This is a problem when using markup like
"
this is a test
+ heading
test 2
----
test3
"
This will lead to XHTML validation failures. There will also be <br /> Tags added in front of the Heading and the <hr />-tags, which is not intended, I guess.
The only way to work around this without touching the code is changing the markup to
"
this is a test
+ heading
test 2
----
test3
"
As a temporary workaround I meanwhile changed the "prefilter" rule of my local copy by adding
$this->wiki->source = str_replace("\n----\n","\n\n----\n\n", $this->wiki->source);
$this->wiki->source = preg_replace("/\n(\\+{1,6}) (.*)\n/m", "\n\n\\1 \\2\n\n", $this->wiki->source);
before the stripping of the unnecessary triple-\n's