* @return string
*/
public static function tocIndent() {
- return "\n<ul>";
+ return "\n<ul>\n";
}
/**
$classes .= " tocsection-$sectionIndex";
}
- // \n<li class="$classes"><a href="#$anchor"><span class="tocnumber">
+ // <li class="$classes"><a href="#$anchor"><span class="tocnumber">
// $tocnumber</span> <span class="toctext">$tocline</span></a>
- return "\n" . Html::openElement( 'li', [ 'class' => $classes ] )
+ return Html::openElement( 'li', [ 'class' => $classes ] )
. Html::rawElement( 'a',
[ 'href' => "#$anchor" ],
Html::element( 'span', [ 'class' => 'tocnumber' ], $tocnumber )
# @todo consider using a stack for nestable elements like span, table and div
// P-wrapping and indent-pre are suppressed inside, not outside
- $blockElems = 'table|h1|h2|h3|h4|h5|h6|pre|p|ul|ol|dl|li';
+ $blockElems = 'table|h1|h2|h3|h4|h5|h6|pre|p|ul|ol|dl';
// P-wrapping and indent-pre are suppressed outside, not inside
$antiBlockElems = 'td|th';
'/<('
. "({$blockElems})|\\/({$antiBlockElems})|"
// Always suppresses
- . '\\/?(tr)'
+ . '\\/?(tr|dt|dd|li)'
. ')\\b/iS',
$t
);
!!end
-!!test
+!! test
Multiple list tags generated by templates
!! wikitext
{{echo|<li>}}a
</li>
</li>
+
!! html+tidy
<li>a
</li><li>b
<li about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[0,44,null,null],"pi":[[{"k":"1"}],[{"k":"1"}],[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<li>"}},"i":0}},"a\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<li>"}},"i":1}},"b\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<li>"}},"i":2}},"c"]}'>a
</li><li about="#mwt1">b
</li><li about="#mwt1" data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[null,44,null,0]}'>c</li>
-!!end
+!! end
+
+!! test
+Multiple newlines in between HTML list items don't induce paragraph wrapping
+!! wikitext
+<ul>
+<li>hi</li>
+
+
+
+
+<li>ho</li>
+</ul>
+
+<dl>
+<dt>hi</dt>
+<dd>ho<div>123</div>
+</dd>
+
+
+</dl>
+!! html/php+tidy
+<ul>
+<li>hi</li>
+
+
+
+
+<li>ho</li>
+</ul>
+<dl>
+<dt>hi</dt>
+<dd>ho<div>123</div>
+</dd>
+
+
+</dl>
+!! end
!!test
Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines