From c9c1d7ae55d43692cd4d8488acc736edc0b325a8 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sun, 21 May 2017 01:47:36 +0200 Subject: [PATCH] Issue #395 - a potential fix --- src/lexer.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lexer.c b/src/lexer.c index 238fbfa..77af713 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -3723,6 +3723,22 @@ static tmbstr ParseAttribute( TidyDocImpl* doc, Bool *isempty, if (TY_(IsWhite)(c)) break; + if (c == '/') /* Issue #395 - potential self closing tag */ + { + c = TY_(ReadChar)(doc->docIn); /* read next */ + if (c == '>') + { + /* got a self closing tag - put is back and continue... */ + TY_(UngetChar)(c, doc->docIn); + break; + } + else + { + /* Not '/>' - put it back */ + TY_(UngetChar)(c, doc->docIn); + } + } + /* what should be done about non-namechar characters? */ /* currently these are incorporated into the attr name */