From 37b555f71ea6ebaea9ff183f186abc46cf9b1a67 Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Sun, 14 Sep 2025 14:40:01 +0300 Subject: Restructure and start working on tests --- src/dompa/html.cljc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/dompa/html.cljc (limited to 'src/dompa/html.cljc') diff --git a/src/dompa/html.cljc b/src/dompa/html.cljc new file mode 100644 index 0000000..6268fa0 --- /dev/null +++ b/src/dompa/html.cljc @@ -0,0 +1,17 @@ +(ns dompa.html + (:require + [dompa.coordinates :as coordinates])) + +(defn ->coordinates + "Transform a `html` string into a vector of coordinates + indicating where an HTML node ends and begins." + [html] + (->> coordinates/compose + (coordinates/unify html))) + +(defn ->nodes + "Transform a `html` string into a tree of nodes, + each representing one HTML node and its children." + [html] + (->> (->coordinates html) + (coordinates/->nodes html))) \ No newline at end of file -- cgit v1.2.3