From 5f163f2b62613368714d8a1e8b342daaac0f89d5 Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Sat, 20 Sep 2025 20:25:34 +0300 Subject: Fix issue with node name capture, add another test case. --- src/dompa/coordinates.cljc | 2 +- src/dompa/html.cljc | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/dompa') diff --git a/src/dompa/coordinates.cljc b/src/dompa/coordinates.cljc index 3584dc9..abaf233 100644 --- a/src/dompa/coordinates.cljc +++ b/src/dompa/coordinates.cljc @@ -149,7 +149,7 @@ (if (str/starts-with? html "<") (->> (subs html 1) (take-while #(not (contains? #{\space \>} %))) - (reduce str) + (apply str) keyword) :dompa/text)) diff --git a/src/dompa/html.cljc b/src/dompa/html.cljc index 6268fa0..cea7b69 100644 --- a/src/dompa/html.cljc +++ b/src/dompa/html.cljc @@ -6,12 +6,14 @@ "Transform a `html` string into a vector of coordinates indicating where an HTML node ends and begins." [html] - (->> coordinates/compose - (coordinates/unify html))) + (->> html + coordinates/compose + coordinates/unify)) (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 + (-> html + ->coordinates + coordinates/->nodes)) \ No newline at end of file -- cgit v1.2.3