   (if (vector? node)
     (hiccup/set-attr node :key (if key-fn (key-fn) 2))
     node))
-
 
 (defn- tags-between [parent-tag loc]
   (take-while #(not= parent-tag %) (reverse (zipper/tag-path loc))))

           :doc-loc (->> loc (insert-node new-node position))
           :selection-focus [new-key nil 0])))

(defn- move-right [[parent text-node _]]
  [parent (inc text-node) 0])

(defn- text-node-index [text-node-loc]
  (count (zip/lefts text-node-loc)))


    [(key-of (zip/up loc)) (text-node-index loc) 0]
    [(key-of loc) 0 0]))

(defn- node-with-tag [loc tag]
  (some #(when (= tag (hiccup/tag (zip/node %))) %) (take-while #(not (nil? %)) (iterate zip/up loc))))

