--- c:\fgcvs\tidy\src\pprint.c Sat Mar 29 12:59:11 2008 +++ tidydev\src\pprint.c Mon Mar 23 11:08:48 2009 @@ -695,9 +695,24 @@ if ( pprint->linelen > 0 ) { + unsigned int i; + for( i = 0; i < pprint->linelen; i++ ) { + if( pprint->linebuf[i] > ' ' ) + break; + } + if(( i < pprint->linelen ) || IsInString(pprint) ) + { + /* do as before */ PFlushLineImpl( doc ); TY_(WriteChar)( '\n', doc->docOut ); + + } + else + { + ResetLine( pprint ); + pprint->linelen = 0; + } pprint->indent[ 0 ].spaces = indent; } } @@ -1733,7 +1748,10 @@ static int TextStartsWithWhitespace( Lexer *lexer, Node *node, uint start, uint mode ) { assert( node != NULL ); - if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsText)(node) && node->end > node->start && start >= node->start ) + if ( (mode & (CDATA|COMMENT)) && + TY_(nodeIsTextLike)(node) && + node->end > node->start && + start >= node->start ) { uint ch, ix = start; /* Skip whitespace. */