Last modified: 2011-11-12 10:21:18 UTC
{{ #subpagelist: page=page | kidsonly=yes }}XX generates code: <div class="subpagelist"> <ul><li><a href="...">Subpage1</a> </li><li><a href="...">Subpage2</a></div>XX </li></ul> Note intersection between div and ul: <div><ul></div></ul>. That's incorrect. must be <div><ul></ul></div>. The problem is in `makeList' function and MediaWiki parser. MediaWiki parsers thinks a list item is finished by newline; while `makeList' function adds newline /before/ each item, and omits newline after the last item of the list.
Created attachment 9344 [details] Bug fix.
Is this a patch against trunk? And can you please not change var names all over the place and make a functional change at the same time? This makes it quite hard to review.
I honestly don't see where the current code is wrong, and how your patch fixes it.
> Is this a patch against trunk? Yes. > And can you please not change var names all over the place and make a functional change at the same time? I change var name because the meaning of the variable is changed. I do not think it would be helpful to use $start variable for a character used for finishing list item. This is exact reason why I named it $itemFinish. > I honestly don't see where the current code is wrong, and how your patch fixes it. Let us consider lists of ul or ol types. makeList generates a newline at the front of each list item, and DOES NOT generate newline at the end of the last item, so result (before pass it to parseWikitext) will be intro...<div> * item1 * item2</div>outro Mwdiawiki parser allows </div>, but does not understand that </div> terminates the item, and generates intro...<div> <ul><li>item1 </li><li>item2</div>outro </li><ul> The problem can be solved by adding newline after the end of last item of the list: intro...<div> * item1 * item2<!-- This newline solves the issue. --> </div>outro So parser will generate intro...<div> <ul><li>item1 </li><li>item2 </li><ul> </div>outro
Created attachment 9348 [details] Alternative fix. Alternative fix. May be it would be easier to understand.
Oh.. So it's the parser messing it up - that explains why I did not see anything wrong :) Will apply your patch later today - thnx!
Applied in r101783
Verified on r102853.