From f3339f8ed121a10a968be256c699273a0411ed65 Mon Sep 17 00:00:00 2001 From: Dmitri Sotnikov Date: Wed, 26 Jul 2017 21:40:17 -0400 Subject: [PATCH 1/9] added HTML escaping --- README.md | 11 ++++++++++- project.clj | 2 +- src/cljs/hiccups/runtime.cljs | 10 ++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4f6a997..0f8a1c9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Differences from Hiccup functions, and `runtime.cljs` contains functions that are also available at runtime. The contents of `runtime.cljs` are also used at compile-time, so the goal is to keep it portable between ClojureScript and Clojure. +* HTML is escaped by default, use `:dangerously-set-inner-HTML` to explicitly disable escaping. * Unit tests are run in a PhantomJS browser using [lein-cljsbuild](https://github.com/emezeske/lein-cljsbuild/) and Closure's testing libs. * Not everything has been ported yet. See ToDo. @@ -36,7 +37,7 @@ Install Add the following dependency to your `project.clj` file: ```clojure -[hiccups "0.3.0"] +[macchiato/hiccups "0.4.0"] ``` Usage @@ -99,6 +100,14 @@ convenient: "" ``` +Disabling HTML escaping is accomplished by using React inspired `:dangerously-set-inner-HTML` attribute: + +```clojure +[:div + {:dangerously-set-inner-HTML + {:__html "

safe html

"}}] +``` + See the [Hiccup wiki](https://github.com/weavejester/hiccup/wiki) for more information. ToDo diff --git a/project.clj b/project.clj index fe8310d..c4804b4 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject hiccups "0.4.0-SNAPSHOT" +(defproject macchiato/hiccups "0.4.0" :description "A ClojureScript port of Hiccup - a fast library for rendering HTML in ClojureScript" :url "http://example.com/FIXME" :license {:name "Eclipse Public License - v 1.0" diff --git a/src/cljs/hiccups/runtime.cljs b/src/cljs/hiccups/runtime.cljs index 2dfcc1c..23fa801 100644 --- a/src/cljs/hiccups/runtime.cljs +++ b/src/cljs/hiccups/runtime.cljs @@ -75,10 +75,16 @@ "Render a tag vector as a HTML element." [element] (let [[tag attrs content] (normalize-element element)] - (if (or content (container-tags tag)) + (cond + (:dangerouslySetInnerHTML attrs) + (-> attrs :dangerouslySetInnerHTML :__html) + (:dangerously-set-inner-HTML attrs) + (-> attrs :dangerously-set-inner-HTML :__html) + (or content (container-tags tag)) (str "<" tag (render-attr-map attrs) ">" (render-html content) "") + :else (str "<" tag (render-attr-map attrs) (end-tag))))) (defn render-html @@ -87,4 +93,4 @@ (cond (vector? x) (render-element x) (seq? x) (apply str (map render-html x)) - :else (as-str x))) + :else (escape-html x))) From 9d8a9dc1b47e06a064c84e08123c9e3e09b86297 Mon Sep 17 00:00:00 2001 From: Dmitri Sotnikov Date: Thu, 27 Jul 2017 08:51:35 -0400 Subject: [PATCH 2/9] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 0f8a1c9..90f5ff7 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,7 @@ Install Add the following dependency to your `project.clj` file: -```clojure -[macchiato/hiccups "0.4.0"] -``` +[![Clojars Project](https://img.shields.io/clojars/v/macchiato/hiccups.svg)](https://clojars.org/macchiato/hiccups) Usage ----- From f567fdafb48b8c2bc32f168a94c02e824bd3f10b Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Thu, 27 Jul 2017 09:36:09 -0400 Subject: [PATCH 3/9] fixed attribute escaping --- project.clj | 74 ++++------ src/cljs/hiccups/runtime.cljs | 4 +- test/cljs/hiccups/core_test.cljs | 223 ++++++++++++++++--------------- 3 files changed, 143 insertions(+), 158 deletions(-) diff --git a/project.clj b/project.clj index faca6ee..a68d172 100644 --- a/project.clj +++ b/project.clj @@ -1,54 +1,38 @@ -(defproject hiccups "0.3.1" +(defproject macchiato/hiccups "0.4.1" :description "A ClojureScript port of Hiccup - a fast library for rendering HTML in ClojureScript" - :url "http://example.com/FIXME" + :url "https://github.com/macchiato-framework/hiccups" :license {:name "Eclipse Public License - v 1.0" - :url "http://www.eclipse.org/legal/epl-v10.html" - :distribution :repo} + :url "http://www.eclipse.org/legal/epl-v10.html"} - ;; Required by cljsbuild plugin :min-lein-version "2.2.0" - - ;; We need to add src/cljs too, because cljsbuild does not add its - ;; source-paths to the project source-paths + :clojurescript? true :source-paths ["src/clj" "src/cljs"] - ;; The libs which the project depends on. - ;; Here we use the latest stable clj and cljs releases - :dependencies [[org.clojure/clojure "1.5.1"] - [org.clojure/clojurescript "0.0-2069"]] + :dependencies [[org.clojure/clojure "1.8.0"] + [org.clojure/clojurescript "1.9.562"]] - ;; The plugins which the project depends on. Here we're using the - ;; experimental 1.0.0-alpha2 release. Change it to the official - ;; 1.0.0 as soon as it will be available - :plugins [[lein-cljsbuild "1.0.0"]] + :plugins [[lein-doo "0.1.7"] + [lein-cljsbuild "1.1.4"]] - ;; Hooks the cljsbuild subtasks to the lein tasks: lein clean, lein - ;; compile, lein test and lein jar - :hooks [leiningen.cljsbuild] + :profiles {:test + {:cljsbuild + {:builds + {:test + {:source-paths ["src/clj" "src/cljs" "test/cljs"] + :compiler {:main hiccups.runner + :output-to "target/test/core.js" + :target :nodejs + :optimizations :none + :source-map true + :pretty-print true}}}} + :doo {:build "test"}}} - ;; Lein-cljsbuild plugin configuration. Here we define one build - ;; only: the one used for packaging any cljs sources in the jar - ;; generated by lein jar command - :cljsbuild - {:builds {;; This build is only used for including any cljs source - ;; in the packaged jar when you issue lein jar command and - ;; any other command that depends on it - :useless - {;; The dir pathnames where cljs sources live. Do not - ;; include here any cljs source which is only used during - ;; development or testing - :source-paths ["src/cljs"] - ;; The :jar true option is not needed to include the CLJS - ;; sources in the packaged jar. This is because we added - ;; the CLJS source codebase to the Leiningen - ;; :source-paths - ;:jar true - ;; Compilation Options - :compiler - {;; The JS file pathname emitted by the compiler - :output-to "dev-resources/public/js/useless.js" - ;; Compiler optimizations option set to :none to speed - ;; up this useless compilation - :optimizations :none - ;; No need to prettify the emitted js file - :pretty-print false}}}}) + :aliases + {"test" + ["do" + ["clean"] + ["with-profile" "test" "doo" "node" "once"]] + "test-watch" + ["do" + ["clean"] + ["with-profile" "test" "doo" "node"]]}) diff --git a/src/cljs/hiccups/runtime.cljs b/src/cljs/hiccups/runtime.cljs index 0824d4c..128ff21 100644 --- a/src/cljs/hiccups/runtime.cljs +++ b/src/cljs/hiccups/runtime.cljs @@ -50,11 +50,11 @@ (true? value) (if (xml-mode?) (xml-attribute name name) - (str " " (as-str name))) + (str " " (escape-html name))) (not value) "" :else - (xml-attribute name (if (map? value) (render-attr-map value) value) false))) + (xml-attribute name (if (map? value) (render-attr-map value) (escape-html value)) false))) (defn render-attr-map [attrs] (apply str diff --git a/test/cljs/hiccups/core_test.cljs b/test/cljs/hiccups/core_test.cljs index 9c51aba..e105705 100644 --- a/test/cljs/hiccups/core_test.cljs +++ b/test/cljs/hiccups/core_test.cljs @@ -1,128 +1,129 @@ ;;; This namespace is used for testing purpose. It use the ;;; clojurescript.test lib. (ns hiccups.core-test - (:require-macros [cemerick.cljs.test :as m :refer (deftest is)] - [hiccups.core :as hiccups]) - (:require [cemerick.cljs.test :as t] - [hiccups.runtime :as hiccupsrt])) + (:require + [cljs.test :refer-macros [is are deftest testing use-fixtures]] + [hiccups.runtime :as hiccupsrt]) + (:require-macros + [hiccups.core :as hiccups])) (deftest runtime-escaped-chars - (is (= (hiccupsrt/escape-html "\"") """)) - (is (= (hiccupsrt/escape-html "<") "<")) - (is (= (hiccupsrt/escape-html ">") ">")) - (is (= (hiccupsrt/escape-html "&") "&")) - (is (= (hiccupsrt/escape-html "foo") "foo"))) + (is (= (hiccupsrt/escape-html "\"") """)) + (is (= (hiccupsrt/escape-html "<") "<")) + (is (= (hiccupsrt/escape-html ">") ">")) + (is (= (hiccupsrt/escape-html "&") "&")) + (is (= (hiccupsrt/escape-html "foo") "foo"))) (deftest tag-names - (is (= (hiccups/html [:div]) "
")) - (is (= (hiccups/html ["div"]) "
")) - (is (= (hiccups/html ['div]) "
")) - (is (= (hiccups/html [:div#foo]) "
")) - (is (= (hiccups/html [:form#sign-in]) "
")) - (is (= (hiccups/html [:input#sign-in-email]) "")) - (is (= (hiccups/html [:div.foo]) "
")) - (is (= (hiccups/html [:div.foo (str "bar" "baz")]) - "
barbaz
")) - (is (= (hiccups/html [:div.a.b]) "
")) - (is (= (hiccups/html [:div.a.b.c]) "
")) - (is (= (hiccups/html [:div#foo.bar.baz]) - "
"))) + (is (= (hiccups/html [:div]) "
")) + (is (= (hiccups/html ["div"]) "
")) + (is (= (hiccups/html ['div]) "
")) + (is (= (hiccups/html [:div#foo]) "
")) + (is (= (hiccups/html [:form#sign-in]) "
")) + (is (= (hiccups/html [:input#sign-in-email]) "")) + (is (= (hiccups/html [:div.foo]) "
")) + (is (= (hiccups/html [:div.foo (str "bar" "baz")]) + "
barbaz
")) + (is (= (hiccups/html [:div.a.b]) "
")) + (is (= (hiccups/html [:div.a.b.c]) "
")) + (is (= (hiccups/html [:div#foo.bar.baz]) + "
"))) (deftest tag-contents - ; empty tags - (is (= (hiccups/html [:div]) "
")) - (is (= (hiccups/html [:h1]) "

")) - (is (= (hiccups/html [:script]) "")) - (is (= (hiccups/html [:text]) "")) - (is (= (hiccups/html [:a]) "")) - (is (= (hiccups/html [:iframe]) "")) - ; tags containing text - (is (= (hiccups/html [:text "Lorem Ipsum"]) "Lorem Ipsum")) - ; contents are concatenated - (is (= (hiccups/html [:body "foo" "bar"]) "foobar")) - (is (= (hiccups/html [:body [:p] [:br]]) "


")) - ; seqs are expanded - (is (= (hiccups/html [:body (list "foo" "bar")]) "foobar")) - (is (= (hiccups/html (list [:p "a"] [:p "b"])) "

a

b

")) - ; tags can contain tags - (is (= (hiccups/html [:div [:p]]) "

")) - (is (= (hiccups/html [:div [:b]]) "
")) - (is (= (hiccups/html [:p [:span [:a "foo"]]]) - "

foo

"))) + ; empty tags + (is (= (hiccups/html [:div]) "
")) + (is (= (hiccups/html [:h1]) "

")) + (is (= (hiccups/html [:script]) "")) + (is (= (hiccups/html [:text]) "")) + (is (= (hiccups/html [:a]) "")) + (is (= (hiccups/html [:iframe]) "")) + ; tags containing text + (is (= (hiccups/html [:text "Lorem Ipsum"]) "Lorem Ipsum")) + ; contents are concatenated + (is (= (hiccups/html [:body "foo" "bar"]) "foobar")) + (is (= (hiccups/html [:body [:p] [:br]]) "


")) + ; seqs are expanded + (is (= (hiccups/html [:body (list "foo" "bar")]) "foobar")) + (is (= (hiccups/html (list [:p "a"] [:p "b"])) "

a

b

")) + ; tags can contain tags + (is (= (hiccups/html [:div [:p]]) "

")) + (is (= (hiccups/html [:div [:b]]) "
")) + (is (= (hiccups/html [:p [:span [:a "foo"]]]) + "

foo

"))) (deftest tag-attributes - ; tag with blank attribute map - (is (= (hiccups/html [:xml {}]) "")) - ; tag with populated attribute map - (is (= (hiccups/html [:xml {:a "1", :b "2"}]) "")) - (is (= (hiccups/html [:img {"id" "foo"}]) "")) - (is (= (hiccups/html [:img {'id "foo"}]) "")) - (is (= (hiccups/html [:xml {:a "1", 'b "2", "c" "3"}]) - "")) - ; attribute values are escaped - (is (= (hiccups/html [:div {:id "\""}]) "
")) - ; boolean attributes - (is (= (hiccups/html [:input {:type "checkbox" :checked true}]) - "")) - (is (= (hiccups/html [:input {:type "checkbox" :checked false}]) - "")) - ; nil attributes - (is (= (hiccups/html [:span {:class nil} "foo"]) - "foo"))) + ; tag with blank attribute map + (is (= (hiccups/html [:xml {}]) "")) + ; tag with populated attribute map + (is (= (hiccups/html [:xml {:a "1", :b "2"}]) "")) + (is (= (hiccups/html [:img {"id" "foo"}]) "")) + (is (= (hiccups/html [:img {'id "foo"}]) "")) + (is (= (hiccups/html [:xml {:a "1", 'b "2", "c" "3"}]) + "")) + ; attribute values are escaped + (is (= (hiccups/html [:div {:id "\""}]) "
")) + ; boolean attributes + (is (= (hiccups/html [:input {:type "checkbox" :checked true}]) + "")) + (is (= (hiccups/html [:input {:type "checkbox" :checked false}]) + "")) + ; nil attributes + (is (= (hiccups/html [:span {:class nil} "foo"]) + "foo"))) (deftest compiled-tags - ; tag content can be vars - (is (= (let [x "foo"] (hiccups/html [:span x])) "foo")) - ; tag content can be forms - (is (= (hiccups/html [:span (str (+ 1 1))]) "2")) - (is (= (hiccups/html [:span ({:foo "bar"} :foo)]) "bar")) - ; attributes can contain vars - (let [x "foo"] - (is (= (hiccups/html [:xml {:x x}]) "")) - (is (= (hiccups/html [:xml {x "x"}]) "")) - (is (= (hiccups/html [:xml {:x x} "bar"]) "bar"))) - ; attributes are evaluated - (is (= (hiccups/html [:img {:src (str "/foo" "/bar")}]) - "")) - (is (= (hiccups/html [:div {:id (str "a" "b")} (str "foo")]) - "
foo
")) - ; optimized forms - (is (= (hiccups/html [:ul (for [n (range 3)] - [:li n])]) - "
  • 0
  • 1
  • 2
")) - (is (= (hiccups/html [:div (if true - [:span "foo"] - [:span "bar"])]) - "
foo
")) - ; values are evaluated only once - (let [times-called (atom 0) - foo #(do (swap! times-called inc) "foo")] - (hiccups/html [:div (foo)]) - (is (= 1 @times-called)))) + ; tag content can be vars + (is (= (let [x "foo"] (hiccups/html [:span x])) "foo")) + ; tag content can be forms + (is (= (hiccups/html [:span (str (+ 1 1))]) "2")) + (is (= (hiccups/html [:span ({:foo "bar"} :foo)]) "bar")) + ; attributes can contain vars + (let [x "foo"] + (is (= (hiccups/html [:xml {:x x}]) "")) + (is (= (hiccups/html [:xml {x "x"}]) "")) + (is (= (hiccups/html [:xml {:x x} "bar"]) "bar"))) + ; attributes are evaluated + (is (= (hiccups/html [:img {:src (str "/foo" "/bar")}]) + "")) + (is (= (hiccups/html [:div {:id (str "a" "b")} (str "foo")]) + "
foo
")) + ; optimized forms + (is (= (hiccups/html [:ul (for [n (range 3)] + [:li n])]) + "
  • 0
  • 1
  • 2
")) + (is (= (hiccups/html [:div (if true + [:span "foo"] + [:span "bar"])]) + "
foo
")) + ; values are evaluated only once + (let [times-called (atom 0) + foo #(do (swap! times-called inc) "foo")] + (hiccups/html [:div (foo)]) + (is (= 1 @times-called)))) (deftest defhtml-macro - ; basic html function - (hiccups/defhtml basic-fn [x] [:span x]) - (is (= (basic-fn "foo") "foo")) - ; html function with overloads - (hiccups/defhtml overloaded-fn - ([x] [:span x]) - ([x y] [:span x [:div y]])) - (is (= (overloaded-fn "foo") "foo")) - (is (= (overloaded-fn "foo" "bar") - "foo
bar
"))) + ; basic html function + (hiccups/defhtml basic-fn [x] [:span x]) + (is (= (basic-fn "foo") "foo")) + ; html function with overloads + (hiccups/defhtml overloaded-fn + ([x] [:span x]) + ([x y] [:span x [:div y]])) + (is (= (overloaded-fn "foo") "foo")) + (is (= (overloaded-fn "foo" "bar") + "foo
bar
"))) (deftest render-modes - ; "closed tag" - (is (= (hiccups/html [:br]) "
")) - (is (= (hiccups/html {:mode :xml} [:br]) "
")) - (is (= (hiccups/html {:mode :sgml} [:br]) "
")) - (is (= (hiccups/html {:mode :html} [:br]) "
")) - ; boolean attributes - (is (= (hiccups/html {:mode :xml} [:input {:type "checkbox" :checked true}]) - "")) - (is (= (hiccups/html {:mode :sgml} [:input {:type "checkbox" :checked true}]) - "")) - ; "laziness and binding scope" - (is (= (hiccups/html {:mode :sgml} [:html [:link] (list [:link])]) - ""))) + ; "closed tag" + (is (= (hiccups/html [:br]) "
")) + (is (= (hiccups/html {:mode :xml} [:br]) "
")) + (is (= (hiccups/html {:mode :sgml} [:br]) "
")) + (is (= (hiccups/html {:mode :html} [:br]) "
")) + ; boolean attributes + (is (= (hiccups/html {:mode :xml} [:input {:type "checkbox" :checked true}]) + "")) + (is (= (hiccups/html {:mode :sgml} [:input {:type "checkbox" :checked true}]) + "")) + ; "laziness and binding scope" + (is (= (hiccups/html {:mode :sgml} [:html [:link] (list [:link])]) + ""))) From bc315f5d9f633168da33946069f2447d35b967cf Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Thu, 18 Jan 2018 17:42:54 -0500 Subject: [PATCH 4/9] added test runner --- test/cljs/hiccups/runner.cljs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/cljs/hiccups/runner.cljs diff --git a/test/cljs/hiccups/runner.cljs b/test/cljs/hiccups/runner.cljs new file mode 100644 index 0000000..8b395ae --- /dev/null +++ b/test/cljs/hiccups/runner.cljs @@ -0,0 +1,6 @@ +(ns hiccups.runner + (:require + [doo.runner :refer-macros [doo-tests]] + [hiccups.core-test])) + +(doo-tests 'hiccups.core-test) From e709d915d2fc42acabab566fba3811e7082f634d Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Wed, 15 Jan 2020 10:42:41 -0500 Subject: [PATCH 5/9] updated project structure to be NPM compatible --- package.json | 20 ++++++++++++++++++++ project.clj | 12 ++++++------ src/{clj => }/hiccups/core.clj | 0 src/{clj => }/hiccups/runtime.clj | 0 src/{cljs => }/hiccups/runtime.cljs | 0 5 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 package.json rename src/{clj => }/hiccups/core.clj (100%) rename src/{clj => }/hiccups/runtime.clj (100%) rename src/{cljs => }/hiccups/runtime.cljs (100%) diff --git a/package.json b/package.json new file mode 100644 index 0000000..3f9f2fc --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "hiccups", + "version": "0.4.2", + "description": "A library for rendering HTML in ClojureScript ", + "author": "Dmitri Sotnokov", + "homepage": "https://github.com/macchiato-framework/hiccups", + "license": "EPL-1.0", + "directories": { + "lib": "src" + }, + "files": [ + "src/*" + ], + "keywords": [ + "cljs", + "cljc", + "html", + "templating" + ] +} diff --git a/project.clj b/project.clj index a68d172..d0e227b 100644 --- a/project.clj +++ b/project.clj @@ -1,15 +1,15 @@ -(defproject macchiato/hiccups "0.4.1" - :description "A ClojureScript port of Hiccup - a fast library for rendering HTML in ClojureScript" +(defproject macchiato/hiccups "0.4.2" + :description "a library for rendering HTML in ClojureScript using Hiccup syntax" :url "https://github.com/macchiato-framework/hiccups" :license {:name "Eclipse Public License - v 1.0" :url "http://www.eclipse.org/legal/epl-v10.html"} :min-lein-version "2.2.0" :clojurescript? true - :source-paths ["src/clj" "src/cljs"] + :source-paths ["src"] - :dependencies [[org.clojure/clojure "1.8.0"] - [org.clojure/clojurescript "1.9.562"]] + :dependencies [[org.clojure/clojure "1.10.1"] + [org.clojure/clojurescript "1.10.597"]] :plugins [[lein-doo "0.1.7"] [lein-cljsbuild "1.1.4"]] @@ -18,7 +18,7 @@ {:cljsbuild {:builds {:test - {:source-paths ["src/clj" "src/cljs" "test/cljs"] + {:source-paths ["src" "test/cljs"] :compiler {:main hiccups.runner :output-to "target/test/core.js" :target :nodejs diff --git a/src/clj/hiccups/core.clj b/src/hiccups/core.clj similarity index 100% rename from src/clj/hiccups/core.clj rename to src/hiccups/core.clj diff --git a/src/clj/hiccups/runtime.clj b/src/hiccups/runtime.clj similarity index 100% rename from src/clj/hiccups/runtime.clj rename to src/hiccups/runtime.clj diff --git a/src/cljs/hiccups/runtime.cljs b/src/hiccups/runtime.cljs similarity index 100% rename from src/cljs/hiccups/runtime.cljs rename to src/hiccups/runtime.cljs From 5126b64a4ba0003d3603c819a889218740da7a89 Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Wed, 15 Jan 2020 10:49:58 -0500 Subject: [PATCH 6/9] fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 372a9c7..7612da7 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Require both the core macros and the runtime functions in your namespace declara ```clojure (ns myns (:require-macros [hiccups.core :as hiccups :refer [html]]) - (:require [hiccups.runtime :as hiccupsrt])) + (:require [hiccups.runtime :as hiccups])) (hiccups/defhtml my-template [] [:div From b4360c072d0029f7ef726e795b2a2732aff2b7bf Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Wed, 15 Jan 2020 10:53:23 -0500 Subject: [PATCH 7/9] removed unused imports --- src/hiccups/core.clj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hiccups/core.clj b/src/hiccups/core.clj index 8a9b7ec..0d502ad 100644 --- a/src/hiccups/core.clj +++ b/src/hiccups/core.clj @@ -2,8 +2,7 @@ "Library for rendering a tree of vectors into a string of HTML. Pre-compiles where possible for performance. Core macros and their (Clojure) helper functions." - (:require [hiccups.runtime :as rt]) - (:import [clojure.lang IPersistentVector ISeq])) + (:require [hiccups.runtime :as rt])) (def doctype {:html4 From 27410893fa745edf4951f4e986aecd0f27759206 Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Wed, 15 Jan 2020 10:53:57 -0500 Subject: [PATCH 8/9] bumped up package.json version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3f9f2fc..2367469 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hiccups", - "version": "0.4.2", + "version": "0.4.3", "description": "A library for rendering HTML in ClojureScript ", "author": "Dmitri Sotnokov", "homepage": "https://github.com/macchiato-framework/hiccups", From f69530395220ff8e7689cb6546e4e402442f3d82 Mon Sep 17 00:00:00 2001 From: Dmitri Sotnikov Date: Fri, 6 Nov 2020 13:17:15 -0500 Subject: [PATCH 9/9] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7612da7..946998a 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ Add the following dependency to your `project.clj` file: [![Clojars Project](https://img.shields.io/clojars/v/macchiato/hiccups.svg)](https://clojars.org/macchiato/hiccups) +alternatively via NPM + +[![NPM](https://nodei.co/npm/hiccups.png?mini=true)](https://www.npmjs.com/package/hiccups) + Usage -----