From c48680cc017c3ba00a251e800acec9e47ccae616 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Thu, 10 Sep 2015 15:01:48 +0200 Subject: [PATCH] Issue #180 - fix indenting when -omit used --- src/pprint.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pprint.c b/src/pprint.c index 4b4593d..7d011e8 100644 --- a/src/pprint.c +++ b/src/pprint.c @@ -2312,6 +2312,15 @@ void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node ) (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) ) TY_(PFlushLineSmart)( doc, contentIndent ); } + else if ( ShouldIndent(doc, node) ) + { + /*\ + * Issue #180 - If the tag was NOT printed due to the -omit option, + * then reduce the bumped indent under the same ShouldIndent(doc, node) + * conditions that caused the indent to be bumped. + \*/ + contentIndent -= spaces; + } last = NULL; for ( content = node->content; content; content = content->next )