From f26a06880991e13dd0600322bdbff9b1ca08263f Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sun, 2 Jul 2017 21:10:20 +0200 Subject: [PATCH 1/2] Issue #572 - More conditions for #396 --- src/parser.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/parser.c b/src/parser.c index a037280..be07b29 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2435,6 +2435,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode)) Lexer* lexer = doc->lexer; Node *node, *parent, *lastli; Bool wasblock; + Bool nodeisOL = nodeIsOL(list); #if !defined(NDEBUG) && defined(_MSC_VER) in_parse_list++; @@ -2452,6 +2453,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode)) while ((node = TY_(GetToken)( doc, IgnoreWhitespace)) != NULL) { + Bool foundLI = no; if (node->tag == list->tag && node->type == EndTag) { TY_(FreeNode)( doc, node); @@ -2521,10 +2523,16 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode)) continue; } - if ( nodeIsLI(node) || TY_(IsHTML5Mode)(doc)) + if ( !nodeIsLI(node) && nodeisOL ) { - /* node is
  • - Issue #396 - A