diff options
author | Joakim Verona <joakim@verona.se> | 2011-09-14 11:45:59 +0200 |
---|---|---|
committer | Joakim Verona <joakim@verona.se> | 2011-09-14 11:45:59 +0200 |
commit | 8d07d23ecd32b9e9f07234313c2e712a8c42b524 (patch) | |
tree | d5d925a00733d9a6d1f637b8f3dfdd40c33a2fe7 /src/xml.c | |
parent | 8918dacdb34e848edcd894e32de5b7b4e2fa19ea (diff) | |
parent | 46888499da0bb61ce47d339275d5a0c757a02eb2 (diff) | |
download | emacs-8d07d23ecd32b9e9f07234313c2e712a8c42b524.tar.gz emacs-8d07d23ecd32b9e9f07234313c2e712a8c42b524.tar.bz2 emacs-8d07d23ecd32b9e9f07234313c2e712a8c42b524.zip |
upstream
Diffstat (limited to 'src/xml.c')
-rw-r--r-- | src/xml.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/xml.c b/src/xml.c index 8b485e73649..f0422875f7e 100644 --- a/src/xml.c +++ b/src/xml.c @@ -124,6 +124,8 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html if (doc != NULL) { + /* If the document is just comments, then this should get us the + nodes anyway. */ xmlNode *n = doc->children->next; Lisp_Object r = Qnil; @@ -134,9 +136,13 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html n = n->next; } - if (NILP (result)) - result = r; - else + if (NILP (result)) { + /* The document isn't just comments, so get the tree the + proper way. */ + xmlNode *node = xmlDocGetRootElement (doc); + if (node != NULL) + result = make_dom (node); + } else result = Fcons (intern ("top"), Fcons (Qnil, Fnreverse (Fcons (r, result)))); |