From: Lars Magne Ingebrigtsen Date: Mon, 6 Dec 2010 16:59:52 +0000 (+0100) Subject: Return CDATA sections (like ) as text nodes. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~35 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3c2317e89100833812a7194c0d9d39ae0f52cb33;p=emacs.git Return CDATA sections (like ) as text nodes. Also ignore blank HTML nodes. --- diff --git a/src/ChangeLog b/src/ChangeLog index e05855a4abf..47dd5c650c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-12-06 Lars Magne Ingebrigtsen + + * xml.c (parse_region): Ignore blank HTML nodes. + (make_dom): Return CDATA sections (like ) as + text nodes. + 2010-12-06 Stefan Monnier * lread.c (read1): Allow newstyle unquote outside of backquote. 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",