summaryrefslogtreecommitdiff
path: root/src/xml.c
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2010-12-06 17:59:52 +0100
committerLars Magne Ingebrigtsen <larsi@gnus.org>2010-12-06 17:59:52 +0100
commit3c2317e89100833812a7194c0d9d39ae0f52cb33 (patch)
treeedaeb216298a16f6c66631e0848d32f430787e63 /src/xml.c
parentce327e48a158a1b59c6ccf54c26763c3460ca268 (diff)
downloademacs-3c2317e89100833812a7194c0d9d39ae0f52cb33.tar.gz
Return CDATA sections (like <style>foo</style>) as text nodes.
Also ignore blank HTML nodes.
Diffstat (limited to 'src/xml.c')
-rw-r--r--src/xml.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xml.c b/src/xml.c
index a686e55f0b0..fde9d4d382a 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -62,7 +62,7 @@ Lisp_Object make_dom (xmlNode *node)
return Fnreverse (result);
}
- else if (node->type == XML_TEXT_NODE)
+ else if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE)
{
if (node->content)
return build_string (node->content);
@@ -105,7 +105,8 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html
doc = htmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)),
bytes, burl, "utf-8",
HTML_PARSE_RECOVER|HTML_PARSE_NONET|
- HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR);
+ HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR|
+ HTML_PARSE_NOBLANKS);
else
doc = xmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)),
bytes, burl, "utf-8",