diff --git a/dom.d b/dom.d index c28fd46..cea589a 100644 --- a/dom.d +++ b/dom.d @@ -3396,8 +3396,16 @@ class Element : DomParent { } protected string toPrettyStringIndent(bool insertComments, int indentationLevel, string indentWith) const { - if(indentWith is null || this.isEmpty()) + if(indentWith is null) return null; + + // at the top we don't have anything to really do + if(parent_ is null) + return null; + + // I've used isEmpty before but this other check seems better.... + //|| this.isEmpty()) + string s; if(insertComments) s ~= "