Unexpected div & header combination output

7 views
Skip to first unread message

David

unread,
Sep 25, 2013, 5:18:08 AM9/25/13
to bl...@googlegroups.com, Me
Hi,

I'm running some text through the conversion from HTML to wiki and have noticed some, what I would think would be, unexpected output. I'm hoping to have headers created in divs but they seem to slip out of them, this could be expected behaviour but I thought I would offer it up for consumption.

Running this through http://w-i-k-i.appspot.com/ and my own instance of the parser...

<div class="container marketing">
<div class="row">
<div class="col-lg-3">
== Heading == 
</div>
<div class="col-lg-3">
== Heading == 
</div>
<div class="col-lg-3">
== Heading == 
</div>
</div>
</div>

...gave...

<div class="container marketing">
<div class="row">
<div class="col-lg-3">
</div></div></div><h2><span class="mw-headline" id="Heading">Heading</span></h2>
<div class="col-lg-3">
</div><h2><span class="mw-headline" id="Heading_2">Heading</span></h2>
<div class="col-lg-3">
</div><h2><span class="mw-headline" id="Heading_3">Heading</span></h2>



I would have though that it would have given...


<div class="container marketing">
<div class="row">
<div class="col-lg-3">
<h2><span class="mw-headline" id="Heading">Heading</span></h2></div>
<div class="col-lg-3">
<h2><span class="mw-headline" id="Heading_2">Heading</span></h2></div>
<div class="col-lg-3">
<h2><span class="mw-headline" id="Heading_3">Heading</span></h2></div>
</div></div>


To me that seems like the divs are not being set right, the two bottom </div> come out early and the headers are never placed in the col-lg-3 divs?

Cheers,


axelclk

unread,
Oct 1, 2013, 2:08:22 PM10/1/13
to bl...@googlegroups.com, Me
Hi

This is the default behaviour, because we assume that if a new section header starts in the wiki page we start with new HTML tag stack.

You can try to remove the reduceTokenStack() method call in the WikipediaParser#parseSectionHeaders() method.
Reply all
Reply to author
Forward
0 new messages