diff --git a/src/parser.c b/src/parser.c index 4fb7a8c..30a9911 100644 --- a/src/parser.c +++ b/src/parser.c @@ -3851,7 +3851,15 @@ Bool TY_(FindNodeWithId)( Node *node, TidyTagId tid ) { if (TagIsId(node,tid)) return yes; - for (content = node->content; content; content = content->content) + /*\ + * Issue #459 - Under certain circumstances, with many node this use of + * 'for (content = node->content; content; content = content->content)' + * would produce a **forever** circle, or at least a very extended loop... + * It is sufficient to test the content, if it exists, + * to quickly iterate all nodes. Now all nodes are tested only once. + \*/ + content = node->content; + if (content) { if (TY_(FindNodeWithId)(content,tid)) return yes; diff --git a/version.txt b/version.txt index 9c3783d..f9c3f12 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -5.3.11 -2016.09.11 +5.3.12 +2016.10.14