(line->hiccup line tags-for-line)
Returns the given line with Hiccup-compatible data structures added.
Spec
(clojure.spec.alpha/fspec
:args
(clojure.spec.alpha/cat
:line
clojure.core/string?
:tags-for-line
(clojure.spec.alpha/nilable :tag-soup.core/tags-for-line))
:ret
(clojure.spec.alpha/coll-of clojure.core/any?)
:fn
nil)
Source
(defn line->hiccup
"Returns the given line with Hiccup-compatible data structures added."
[line tags-for-line]
(let [hiccup-per-column (into [] tags-for-line->hiccup (sort-by :column tags-for-line))
segments (map list (line->segments line tags-for-line false))]
(apply concat (interleave segments (concat hiccup-per-column (repeat nil))))))