all repos — archive/microformats @ e2571e582fe302337924ecc6aea27505b94b982a

Incomplete Clojure microformats library

Fix error parsing dt value from unexpected element

Alan Pearce
commit

e2571e582fe302337924ecc6aea27505b94b982a

parent

2beb34d0d9481faa111567b6faf019c0c179c591

2 files changed, 5 insertions(+), 1 deletion(-)

jump to
M src/microformats/parser.cljsrc/microformats/parser.clj
@@ -135,7 +135,8 @@ :ins (-> el :attrs :datetime)
:del (-> el :attrs :datetime) :abbr (-> el :attrs :title) :data (-> el :attrs :value) - :input (-> el :attrs :value)) + :input (-> el :attrs :value) + nil) (node-to-text (:content el)) "")))
M test/microformats/parser_expectations.cljtest/microformats/parser_expectations.clj
@@ -130,6 +130,9 @@
(expect {:start '("2012-08-05T14:50")} (parse-dt (snippet "<input class=\"dt-start\" value=\"2012-08-05T14:50\">"))) +(expect {:start '("2012-08-05T14:50")} + (parse-dt (snippet "<span class=\"dt-start\">2012-08-05T14:50</span>"))) + (expect {:content '({:html "Here is a load of <strong>embedded markup</strong>" :value "Here is a load of embedded markup"})} (parse-e (snippet "<div class=\"e-content\">Here is a load of <strong>embedded markup</strong></div>")))