structr/structr — pull request #53 by vigorouscoding (2013-06-16 11:30:06+00:00)
Title: Changes to HTML output and indentation

- Writing a now checks the avoidWhitespace() method before the opening .
- A newline + indentation is written before the closing if any of the childnodes created a newline (avoidWhitespace() == false).
- instead of calling the indent()-method and then deciding to indent or not, now we check first and then call the method or we don't. (saves the creation of a StringBuilder and one append-operation)
- removed the overridden avoidWhitespace() method from

elements

it's still not perfect, but i think it fails in fewer cases than the previous solution.

the check (subNode instanceof DOMElement) is rather ugly. it is the quick way of doing it. I could have also changed the render-method to return the desired information, but that would have been a bit extensive.