From c7250749ab01721b55a26d6badf4dcdbbdaf7309 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 28 Dec 2013 19:14:51 +0100 Subject: Fix issue where deprecated syntax for HTML lists was not handled properly (#1488768) --- tests/Framework/Washtml.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'tests') diff --git a/tests/Framework/Washtml.php b/tests/Framework/Washtml.php index 0d050ff30..7485d4383 100644 --- a/tests/Framework/Washtml.php +++ b/tests/Framework/Washtml.php @@ -81,4 +81,47 @@ class Framework_Washtml extends PHPUnit_Framework_TestCase $this->assertRegExp('||', $washed, "Invalid closing tag (#1489446)"); } + /** + * Test fixing of invalid lists nesting (#1488768) + */ + function test_lists() + { + $data = array( + array( + "
  1. First
  2. Second
  3. Third
", + "
  1. First
  2. Second
    • First sub
  3. Third
" + ), + array( + "
  1. First
    • First sub
", + "
  1. First
    • First sub
", + ), + array( + "
  1. First
    1. First sub
", + "
  1. First
    1. First sub
", + ), + array( + "", + "", + ), + array( + "", + "", + ), + array( + "
    ", + "
      ", + ), + array( + "
        ", + "
          ", + ), + ); + + foreach ($data as $element) { + rcube_washtml::fix_broken_lists($element[0]); + + $this->assertSame($element[1], $element[0], "Broken nested lists (#1488768)"); + } + } + } -- cgit v1.2.3