diff options
| author | Lars Magne Ingebrigtsen | 2010-12-06 17:59:52 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2010-12-06 17:59:52 +0100 |
| commit | 3c2317e89100833812a7194c0d9d39ae0f52cb33 (patch) | |
| tree | edaeb216298a16f6c66631e0848d32f430787e63 /src | |
| parent | ce327e48a158a1b59c6ccf54c26763c3460ca268 (diff) | |
| download | emacs-3c2317e89100833812a7194c0d9d39ae0f52cb33.tar.gz emacs-3c2317e89100833812a7194c0d9d39ae0f52cb33.zip | |
Return CDATA sections (like <style>foo</style>) as text nodes.
Also ignore blank HTML nodes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xml.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e05855a4abf..47dd5c650c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-12-06 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * xml.c (parse_region): Ignore blank HTML nodes. | ||
| 4 | (make_dom): Return CDATA sections (like <style>foo</style>) as | ||
| 5 | text nodes. | ||
| 6 | |||
| 1 | 2010-12-06 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2010-12-06 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * lread.c (read1): Allow newstyle unquote outside of backquote. | 9 | * lread.c (read1): Allow newstyle unquote outside of backquote. |
| @@ -62,7 +62,7 @@ Lisp_Object make_dom (xmlNode *node) | |||
| 62 | 62 | ||
| 63 | return Fnreverse (result); | 63 | return Fnreverse (result); |
| 64 | } | 64 | } |
| 65 | else if (node->type == XML_TEXT_NODE) | 65 | else if (node->type == XML_TEXT_NODE || node->type == XML_CDATA_SECTION_NODE) |
| 66 | { | 66 | { |
| 67 | if (node->content) | 67 | if (node->content) |
| 68 | return build_string (node->content); | 68 | return build_string (node->content); |
| @@ -105,7 +105,8 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html | |||
| 105 | doc = htmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), | 105 | doc = htmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), |
| 106 | bytes, burl, "utf-8", | 106 | bytes, burl, "utf-8", |
| 107 | HTML_PARSE_RECOVER|HTML_PARSE_NONET| | 107 | HTML_PARSE_RECOVER|HTML_PARSE_NONET| |
| 108 | HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR); | 108 | HTML_PARSE_NOWARNING|HTML_PARSE_NOERROR| |
| 109 | HTML_PARSE_NOBLANKS); | ||
| 109 | else | 110 | else |
| 110 | doc = xmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), | 111 | doc = xmlReadMemory (BYTE_POS_ADDR (CHAR_TO_BYTE (istart)), |
| 111 | bytes, burl, "utf-8", | 112 | bytes, burl, "utf-8", |