You are here: Foswiki>Tasks Web>Item13207 (05 Jul 2015, GeorgeClark)Edit Attach

Item13207: wiki markup not rendered the line before a table

pencil
Priority: Urgent
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: FoswikiRender, WysiwygPlugin
Branches: master
Reported By: MichaelDaum
Waiting For:
Last Change By: GeorgeClark
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

WikiMarkupSnap1.png

Should be

Syntax

data data

Syntax

data data

Syntax

data data

Syntax Syntax

data data

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

 

ItemTemplate edit

Summary wiki markup not rendered the line before a table
ReportedBy MichaelDaum
Codebase
SVN Range
AppliesTo Engine
Component FoswikiRender, WysiwygPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:fe71c45005eb
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:fe71c45005eb
ItemBranchCheckins
Release01x01Checkins
I Attachment Action Size Date Who Comment
WikiMarkupSnap1.pngpng WikiMarkupSnap1.png manage 6 K 12 Jan 2015 - 12:19 MichaelDaum  
Topic revision: r3 - 05 Jul 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy