Commit 4df7db00 authored by Erik Huelsmann's avatar Erik Huelsmann

Compensate the news generator for input change

Note that the news box generator used to receive just the 'main'
tag's content whereas it now receives the entire HTML document.
We need to expand the parser to extract the part it originally
received and process that like we used to.
parent a7714620
......@@ -126,15 +126,37 @@
node))
(loop
;;(print state)
;;(print node)
;;(describe node)
(ecase state
(:start
(if (and (plump:element-p node)
(equalp (plump:tag-name node) "html"))
(setf state :html
node (plump:first-child node))
;; else
(next-node)))
(:html
(if (and (plump:element-p node)
(equalp (plump:tag-name node) "body"))
(setf state :body
node (plump:first-child node))
;; else
(next-node)))
(:body
(if (and (plump:element-p node)
(equalp (plump:tag-name node) "main"))
(setf state :main
node (plump:first-child node))
(next-node)))
(:main
(if (and (plump:element-p node)
(equalp (plump:tag-name node) "h3"))
(setf state :read-news-heading)
;; else
(next-node)))
(:read-news-heading
;; If enough news, exit
......@@ -158,7 +180,7 @@
(progn
(plump:append-child current-news (shallow-copy-object node))
(next-node)
(setf state :start))
(setf state :main))
;; else
(next-node)))))))
(plump:serialize news nil))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment