From f7658b2c8926984b8c8edca2f71effeed562369b Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Fri, 4 Aug 2017 14:23:14 +0200 Subject: [PATCH] Issue #582 - Remove extra new line in 'classic' mode --- src/pprint.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pprint.c b/src/pprint.c index 68e8d44..87568b0 100644 --- a/src/pprint.c +++ b/src/pprint.c @@ -2340,7 +2340,8 @@ void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node ) else /* other tags */ { Bool indcont = ( cfgAutoBool(doc, TidyIndentContent) != TidyNoState ); - Bool indsmart = ( cfgAutoBool(doc, TidyIndentContent) == TidyAutoState ); + /* Issue #582 - Seems this is no longer used + Bool indsmart = ( cfgAutoBool(doc, TidyIndentContent) == TidyAutoState ); */ Bool hideend = cfgBool( doc, TidyOmitOptionalTags ); Bool classic = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */ uint contentIndent = indent; @@ -2360,9 +2361,11 @@ void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node ) * Issue #180 - with the above PCondFlushLine, * this adds an uneccessary additional line! * Maybe only if 'classic' ie --vertical-space yes + * Issue #582 - maybe this is no longer needed! + * It adds a 3rd newline if indent: auto... + * if ( indsmart && node->prev != NULL && classic) + * TY_(PFlushLineSmart)( doc, indent ); \*/ - if ( indsmart && node->prev != NULL && classic) - TY_(PFlushLineSmart)( doc, indent ); /* do not omit elements with attributes */ if ( !hideend || !TY_(nodeHasCM)(node, CM_OMITST) ||