diff options
| author | Asko Nõmm <asko@nmm.ee> | 2025-09-14 14:40:01 +0300 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2025-09-14 14:40:01 +0300 |
| commit | 37b555f71ea6ebaea9ff183f186abc46cf9b1a67 (patch) | |
| tree | cd2fb542c4654af2bb4446a442fdc3550a813379 /src/dompa/html.cljc | |
| parent | c9fb6f1c80a83f9e8ea88f7db3caedae57985fd7 (diff) | |
Restructure and start working on tests
Diffstat (limited to 'src/dompa/html.cljc')
| -rw-r--r-- | src/dompa/html.cljc | 17 |
1 files changed, 17 insertions, 0 deletions
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 |
