From 7e69ceb3d1fea1e6cbab7feacbfce7607ec71b49 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Wed, 7 Oct 2015 16:16:02 +0200 Subject: [PATCH] Issue #281 - only warn BAD_CDATA_CONTENT if inserting an escape. --- src/lexer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lexer.c b/src/lexer.c index 8477c91..47bea03 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -2132,11 +2132,13 @@ static Node *GetCDATA( TidyDocImpl* doc, Node *container ) /* if the end tag is not already escaped using backslash */ SetLexerLocus( doc, lexer ); lexer->columns -= 3; - TY_(ReportError)(doc, NULL, NULL, BAD_CDATA_CONTENT); /* if javascript insert backslash before / */ if (TY_(IsJavaScript)(container)) { + /* Issue #281 - only warn if adding the escape! */ + TY_(ReportError)(doc, NULL, NULL, BAD_CDATA_CONTENT); + for (i = lexer->lexsize; i > start-1; --i) lexer->lexbuf[i] = lexer->lexbuf[i-1];