Fix bug in dl-dt list output generation
authorSubramanya Sastry <ssastry@wikimedia.org>
Wed, 6 Sep 2017 22:47:54 +0000 (17:47 -0500)
committerTim Starling <tstarling@wikimedia.org>
Tue, 12 Sep 2017 01:10:44 +0000 (01:10 +0000)
commitea3b95e20d7f5cf6f585b622b8bae0bf42f11f1c
treeb153e820fab7b02dd5192626db91ed0fe5dbd205
parent5ad3e042b5bf3c4c425a0377e397df7805e37a7f
Fix bug in dl-dt list output generation

* An open <dt> (;) should be closed when we encounter a new <dd> (:)
  char even if it is on a new line that has other nested lists inside.

* Tidy was hiding this PHP parser bug by closing a <dt> and opening
  a <dd> when given this HTML: "<dl><dt>a<ul><li>b</li></ul></dt></dl>"
  It generates "<dl><dt>a</dt><dd><ul><li>b</li></ul></dd></dl>"

  However, a HTML5 parser like RemexHTML, domino (used by Parsoid),
  or browsers don't do this fixup.

* So, what I thought was a bug in RemexHTML turned out to be a bug
  in the PHP parser that was being hidden by the use of Tidy.

* Added a regression test.

Bug: T175099
Change-Id: I6d5b225b82cecf9a43f23837ed8ec359b31aadad
includes/parser/BlockLevelPass.php
tests/parser/parserTests.txt