summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-11-06 10:02:17 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2012-11-06 10:02:17 +0000
commit2385f8269a5871d744cc25770558446cb1d097fb (patch)
tree3865ee2ce150ca99737b9da1097aae5628cee3b4
parentaf1572be92ce94e57a0833fe8a2f9f491a78fc5a (diff)
downloadnetsurf-2385f8269a5871d744cc25770558446cb1d097fb.tar.gz
netsurf-2385f8269a5871d744cc25770558446cb1d097fb.tar.bz2
Fix to escape comments in save complete output.
-rw-r--r--desktop/save_complete.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index 42da86752..7137f0ba9 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -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;