From 4d5f6dabf8b548eccb15d3721ae9497db4da3d6b Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Thu, 9 Dec 2021 22:23:35 -0500 Subject: [PATCH] more toPrettyString tests --- dom.d | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 8 deletions(-) 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 ~= "