/** * Close all unclosed tags if there are any. */ private void closeAll(List nodeList, CleanTimeValues cleanTimeValues) { TagPos firstTagPos = getOpenTags(cleanTimeValues).findFirstTagPos(); for (TagPos pos : getOpenTags(cleanTimeValues).list) { properties.fireHtmlError(true, (TagNode)nodeList.get(pos.position), ErrorType.UnclosedTag); } if (firstTagPos != null) { closeSnippet(nodeList, firstTagPos, null, cleanTimeValues); } }
/** * Close all unclosed tags if there are any. */ private void closeAll(List nodeList, CleanTimeValues cleanTimeValues) { TagPos firstTagPos = getOpenTags(cleanTimeValues).findFirstTagPos(); for (TagPos pos : getOpenTags(cleanTimeValues).list) { if (Thread.currentThread().isInterrupted()) { handleInterruption(); return; } properties.fireHtmlError(true, (TagNode) nodeList.get(pos.position), ErrorType.UnclosedTag); } if (firstTagPos != null) { closeSnippet(nodeList, firstTagPos, null, cleanTimeValues); } }
List closed = closeSnippet(nodeList, matchingPosition, endTagToken, cleanTimeValues); closeSnippet(nodeList, lastTagPos, startTagToken, cleanTimeValues); nodeIterator.previous(); } else if (tag != null && tag.hasPermittedTags() && getOpenTags(cleanTimeValues).someAlreadyOpen(tag.getPermittedTags())) { boolean certainty = startTagToken.hasAttribute("id") ? false : true; properties.fireHtmlError(certainty, (TagNode) nodeList.get(lastTagPos.position), ErrorType.UnpermittedChild); List closed = closeSnippet(nodeList, lastTagPos, startTagToken, cleanTimeValues); int closedCount = closed.size();
List closed = closeSnippet(nodeList, matchingPosition, endTagToken, cleanTimeValues); nodeIterator.set(null); for (int i = closed.size() - 1; i >= 0; i--) { closeSnippet(nodeList, lastTagPos, startTagToken, cleanTimeValues); nodeIterator.previous(); } else if ( tag != null && tag.hasPermittedTags() && getOpenTags(cleanTimeValues).someAlreadyOpen(tag.getPermittedTags()) ) { boolean certainty = startTagToken.hasAttribute("id") ? false : true; properties.fireHtmlError(certainty, (TagNode)nodeList.get(lastTagPos.position), ErrorType.UnpermittedChild); List closed = closeSnippet(nodeList, lastTagPos, startTagToken, cleanTimeValues); int closedCount = closed.size();