diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index 45883fe306f..345d68c8e21 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -1107,6 +1107,15 @@ same as in `newsticker--parse-atom-1.0'." (xml-node-children node)))) (or new-item new-feed))) +(defun newsticker--parse-text-container (node) + "Handle content according to ``type'' attirbute." + (let ((content (car (xml-node-children node)))) + (if (string= "html" (xml-get-attribute node 'type)) + ;; element contains entity escaped html + content + ;; plain text or xhtml + (newsticker--unxml content)))) + (defun newsticker--unxml (node) "Reverse parsing of an xml string. Restore an xml-string from a an xml NODE that was returned by xml-parse..." @@ -1159,23 +1168,14 @@ URL `http://www.atompub.org/2005/08/17/draft-ietf-atompub-format-11.html'" name time (xml-get-children topnode 'entry) ;; title-fn (lambda (node) - (car (xml-node-children - (car (xml-get-children node 'title))))) + (newsticker--parse-text-container + (car (xml-get-children node 'title)))) ;; desc-fn (lambda (node) - ;; unxml the content or the summary node. Atom - ;; allows for integrating (x)html into the atom - ;; structure but we need the raw html string. - ;; e.g. https://www.heise.de/open/news/news-atom.xml - ;; https://feeds.feedburner.com/ru_nix_blogs - (or (newsticker--unxml - (car (xml-node-children - (car (xml-get-children node 'content))))) - (newsticker--unxml - (car (xml-node-children - (car (xml-get-children node 'summary))))) - (car (xml-node-children - (car (xml-get-children node 'summary)))))) + (or (newsticker--parse-text-container + (car (xml-get-children node 'content))) + (newsticker--parse-text-container + (car (xml-get-children node 'summary))))) ;; link-fn (lambda (node) (xml-get-attribute