|
11 | 11 | (ns net.cgrand.enlive-html
|
12 | 12 | "enlive-html is a selector-based transformation and extraction engine."
|
13 | 13 | (:refer-clojure :exclude [flatmap])
|
14 |
| - (:require [net.cgrand.tagsoup :as tagsoup]) |
| 14 | + (:require [net.cgrand.tagsoup :as tagsoup] |
| 15 | + [net.cgrand.jsoup :as jsoup]) |
15 | 16 | (:require [net.cgrand.xml :as xml])
|
16 | 17 | (:require [clojure.string :as str])
|
17 | 18 | (:require [clojure.zip :as z]))
|
|
106 | 107 | [stream loader]
|
107 | 108 | (loader stream))
|
108 | 109 |
|
109 |
| -(defmethod register-resource! java.net.URL |
| 110 | +(defmethod register-resource! java.net.URL |
110 | 111 | [^java.net.URL url]
|
111 | 112 | (alter-meta! *ns* update-in [:net.cgrand.reload/deps] (fnil conj #{}) url))
|
112 | 113 |
|
|
142 | 143 | ([t a b c d e] (-> t (conj! a) (conj! b) (conj! c) (conj! d) (conj! e)))
|
143 | 144 | ([t a b c d e f] (-> t (conj! a) (conj! b) (conj! c) (conj! d) (conj! e) (conj! f)))
|
144 | 145 | ([t a b c d e f g] (-> t (conj! a) (conj! b) (conj! c) (conj! d) (conj! e) (conj! f) (conj! g)))
|
145 |
| - ([t a b c d e f g & more] |
| 146 | + ([t a b c d e f g & more] |
146 | 147 | (reduce conj! (-> t (conj! a) (conj! b) (conj! c) (conj! d) (conj! e) (conj! f) (conj! g))
|
147 | 148 | more)))
|
148 | 149 |
|
|
684 | 685 | :else node)))))
|
685 | 686 |
|
686 | 687 | (defn replace-words
|
687 |
| - "Takes a map of words to replacement strings and replaces |
| 688 | + "Takes a map of words to replacement strings and replaces |
688 | 689 | all occurences. Does not recurse, you have to pair it with an appropriate
|
689 | 690 | selector."
|
690 |
| - [words-to-replacements] |
| 691 | + [words-to-replacements] |
691 | 692 | (replace-vars
|
692 |
| - (java.util.regex.Pattern/compile (str "\\b(" (str/join "|" (map #(java.util.regex.Pattern/quote %) (keys words-to-replacements))) ")\\b")) |
| 693 | + (java.util.regex.Pattern/compile (str "\\b(" (str/join "|" (map #(java.util.regex.Pattern/quote %) (keys words-to-replacements))) ")\\b")) |
693 | 694 | words-to-replacements
|
694 | 695 | identity))
|
695 | 696 |
|
|
0 commit comments