From 96589c6f574d2d2fe5e19d16fc7f818defdb01ef Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Mon, 21 Sep 2015 12:33:53 +0200 Subject: [PATCH] #65 Skip esc'd esc, and only for script containers --- src/lexer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lexer.c b/src/lexer.c index 3aeb47b..42df580 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -1990,6 +1990,10 @@ static Bool IsInQuotesorComment( Lexer * lexer ) } else { + if (( c == '\\' ) && ( prev == '\\' )) { + prev = 0; /* use up the escape */ + continue; /* 5.1.12 #65 (1642186): Ign 'escaped' escape ;=)) eg "+\\" */ + } if (( prev != '\\' ) && (( c == '"' ) || ( c == '\'')) ) { /* deal with 'unescaped' quote chars " or ' */ @@ -2040,8 +2044,9 @@ static Node *GetCDATA( TidyDocImpl* doc, Node *container ) Bool isEmpty = yes; Bool matches = no; uint c; - Bool hasSrc = TY_(AttrGetById)(container, TidyAttr_SRC) != NULL; - Bool skipquotes = cfgBool(doc, TidySkipQuotes); /* #65 - get CONFIG option */ + Bool hasSrc = (TY_(AttrGetById)(container, TidyAttr_SRC) != NULL) ? yes : no; + Bool skipquotes = (nodeIsSCRIPT(container) && + cfgBool(doc, TidySkipQuotes)) ? yes : no; /* #65 (1642186) - is script, and on */ SetLexerLocus( doc, lexer ); lexer->waswhite = no;