aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/html.c6
-rw-r--r--src/libserver/html.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c
index fdb6a11db..edf831238 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -493,6 +493,10 @@ construct_html_node (rspamd_mempool_t * pool, gchar *text, gsize tag_len)
html->flags |= FL_XML;
html->tag = NULL;
}
+ else if (*text == '!') {
+ html->flags |= FL_SGML;
+ html->tag = NULL;
+ }
else {
if (*text == '/') {
html->flags |= FL_CLOSING;
@@ -972,7 +976,7 @@ add_html_node (struct rspamd_task *task,
part->is_balanced = FALSE;
}
}
- else {
+ else if ((data->flags & (FL_XML|FL_SGML)) == 0) {
g_node_append (*cur_level, new);
if ((data->flags & FL_CLOSED) == 0) {
diff --git a/src/libserver/html.h b/src/libserver/html.h
index 6709ed151..1760ad0ca 100644
--- a/src/libserver/html.h
+++ b/src/libserver/html.h
@@ -192,6 +192,8 @@ typedef enum
#define FL_CLOSING (1 << 1)
/* Fully closed tag (e.g. <a attrs />) */
#define FL_CLOSED (1 << 2)
+/* <! SGML tag */
+#define FL_SGML (1 << 3)
struct html_tag {
tag_id_t id;