Fix to escape comments in save complete output.

This commit is contained in:
Michael Drake 2012-11-06 10:02:17 +00:00
parent af1572be92
commit 2385f8269a

View File

@ -868,6 +868,9 @@ static bool save_complete_node_handler(dom_node *node,
return false;
}
if (type == DOM_COMMENT_NODE)
fwrite("<!--", 1, sizeof("<!--") - 1, ctx->fp);
if (text != NULL) {
text_data = dom_string_data(text);
text_len = dom_string_byte_length(text);
@ -877,7 +880,12 @@ static bool save_complete_node_handler(dom_node *node,
dom_string_unref(text);
}
if (type == DOM_COMMENT_NODE) {
fwrite("-->", 1, sizeof("-->") - 1, ctx->fp);
}
}
} else if (type == DOM_DOCUMENT_TYPE_NODE) {
dom_string *name;
const char *name_data;