Merge pull request #583 from htacg/issue-582

Issue #582 - Remove extra new line in 'classic' mode
This commit is contained in:
Jim Derry 2017-08-28 14:24:26 -04:00 committed by GitHub
commit 6533181edf
1 changed files with 6 additions and 3 deletions

View File

@ -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) ||