From 9b431c95a328eaa8cc4d6c916b1e17e0b0e6d701 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 24 Mar 2012 16:59:35 +0000 Subject: And ensure we don't recurse comments and PIs during dom_node_get_text_content svn path=/trunk/libdom/; revision=13603 --- src/core/node.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/node.c') diff --git a/src/core/node.c b/src/core/node.c index 0660c53..1bd7630 100644 --- a/src/core/node.c +++ b/src/core/node.c @@ -1444,6 +1444,9 @@ dom_exception _dom_node_get_text_content(dom_node_internal *node, assert(node->owner != NULL); for (n = node->first_child; n != NULL; n = n->next) { + if (n->type == DOM_COMMENT_NODE || + n->type == DOM_PROCESSING_INSTRUCTION_NODE) + continue; dom_node_get_text_content(n, (str == NULL) ? &str : &ret); if (ret != NULL) { dom_string *new_str; -- cgit v1.2.3