Item13207: wiki markup not rendered the line before a table
Priority: Urgent
Current State: Closed
Released In: 2.0.0
Target Release: major
This bug affects both, the
FoswikiRenderer as well as the
WysiwygPlugin /
TinyMCEPlugin. Both need separate patches.
The bug is triggered when the lines of a chunk of TML is parsed and lists and tables are extracted and inserted back into the text as HTML.
During that course adjacent TML might be affected in a way that the further rendering process does not behave as expected.
You type
*Syntax*
| data | data |
_Syntax_
| data | data |
__Syntax__
| data | data |
*Syntax*
*Syntax*
| data | data |
You get
Should be
Syntax
Syntax
Syntax
Syntax
Syntax
This is caused by the table parser consuming the linefeed before so that when
getRenderedVersion
is called it is faced with this:
_Syntax_<table class='foswikiTable'><tbody><tr ><td> data </td>
<td> data </td>
</tr></tbody></table>
... which then blocks the wiki markup from being expanded.
Patch
This fixes it (adding a space before emitting the
<table class="foswikiTable>
)
diff --git a/core/lib/Foswiki/Render.pm b/core/lib/Foswiki/Render.pm
index 400ce89..2063edb 100644
--- a/core/lib/Foswiki/Render.pm
+++ b/core/lib/Foswiki/Render.pm
@@ -1138,7 +1138,7 @@ sub _addTHEADandTFOOT {
}
$i--;
}
- $lines->[ $i++ ] = "<table class='foswikiTable'>";
+ $lines->[ $i++ ] = " <table class='foswikiTable'>";
if ($headLines) {
splice( @$lines, $i++, 0, '<thead>' );
However I wonder why the table parser consumes the linefeed in the first place.
The list parser seems to behave the same way though does not show the same error. That is wiki markup the line before a list is rendered just fine. The TML renderer seems to emit enough whitespace infront and after a list so that adjacent TML isn't
harmed.
WysiwygPlugin still seems to have problems displaying a proper preview of TML.
--
MichaelDaum - 12 Jan 2015