ZF-5018: HtmlList should insert newline after </li>


The HtmlList View helper now renders all elements on a single line. This gives browsers trouble rendering the items if they are displayed inline using css. All browsers break the lines at odd places.

I will add a Zend_View_Helper_HtmlElement::EOL aftere the opening and closing


ul> tags and after each closing tag.


Added a patch for community evaluation. If no objections are commented here I will commit to trunk.

Please review patch.

Solved in SVN r12984

We broker 3 testcases and introduced a bug with this fix.

If fixed the testcases and the bug, but I commented the latter fix in the wrong issue, but with a matching comment in svn that leads to the correct comment on the wrong issue.

Still not sure if the bugfix is complete, it solves the issue when testing manually, but I will have to look into that again.

For now, I will commit the fixed test.

Changed the original 5 to 6 in this code snippet (the six was needed because we added self:EOL and thus increased the length of with 1)

        foreach ($items as $item) {
            if (!is_array($item)) {
                if ($escape) {
                    $item = $this->view->escape($item);
                $list .= '' . $item . '' . self::EOL;
            } else {
                if (6 < strlen($list)) {
                    $list = substr($list, 0, strlen($list) - 6)
                     . $this->htmlList($item, $ordered, $attribs, $escape) . '' . self::EOL;
                } else {
                    $list .= '' . $this->htmlList($item, $ordered, $attribs, $escape) . '' . self::EOL;

In my previous commit I had omitted the first 5 and did not change it to 6. This may give unexpected results.

This is still broken in 1.7.2

It seems as if Bart's fix did not make it into the 1.7.2 tag