Skip to content

Commit 2557774

Browse files
committed
Issue #329 - Experimental fix?
1 parent 0005841 commit 2557774

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lexer.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static void Show_Node( TidyDocImpl* doc, const char *msg, Node *node )
100100
int col = ( doc->lexer ? doc->lexer->columns : 0 );
101101
SPRTF("R=%d C=%d: ", line, col );
102102
// DEBUG: Be able to set a TRAP on a SPECIFIC row,col
103-
if ((line == 8) && (col == 36)) {
103+
if ((line == 8) && (col == 4)) {
104104
check_me("Show_Node"); // just a debug trap
105105
}
106106
if (lexer && lexer->token &&
@@ -2694,7 +2694,9 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
26942694
{
26952695
c = TY_(ReadChar)(doc->docIn);
26962696

2697-
if (c != '\n' && c != '\f')
2697+
if ((c == '\n') && (mode != IgnoreWhitespace)) /* Issue #329 - Can NOT afford to lose this newline */
2698+
TY_(UngetChar)(c, doc->docIn); /* Issue #329 - make sure the newline is maintained for now */
2699+
else if (c != '\n' && c != '\f')
26982700
TY_(UngetChar)(c, doc->docIn);
26992701

27002702
lexer->waswhite = yes; /* to swallow leading whitespace */

0 commit comments

Comments
 (0)