mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 21:37:34 +00:00
Fix a recent regression in Newsticker
* lisp/net/newst-backend.el (newsticker--parse-text-container): New function. (newsticker--parse-atom-1.0): Use it. (Bug#79617)
This commit is contained in:
parent
4ec24ce2a1
commit
6cb8a67e4b
1 changed files with 15 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue