Back

RawString (clj)

(source)

type

Examples

hiccup
(ns hiccup2.core_test
  (:require [clojure.test :refer :all]
            [hiccup2.core :refer :all]
            [hiccup.util :as util]))

(deftest return-types
  (testing "html returns a RawString"
    (is (util/raw-string? (html [:div]))))
  (testing "converting to string"
    (= (str (html [:div])) "<div></div>")))
hiccup
(ns hiccup.compiler-test
  (:require [clojure.test :refer :all]
            [clojure.walk :as walk]
            [hiccup2.core :refer [html]])
  (:import (hiccup.util RawString)))

(defn- extract-strings [code]
  (->> (tree-seq coll? seq code)
       (filter #(or (string? %)
                    (instance? RawString %)))
       (map str)
       (set)))
babashka/babashka
(ns hiccup2.core-test
  (:require [clojure.test :refer :all]
            [hiccup2.core :refer :all]
            [hiccup.util :as util]))

(deftest return-types
  #_(testing "html returns a RawString"
    (is (util/raw-string? (html [:div]))))
  (testing "converting to string"
    (= (str (html [:div])) "<div></div>")))
weavejester/hiccup
(ns hiccup2.core_test
  (:require [clojure.test :refer :all]
            [hiccup2.core :refer :all]
            [hiccup.util :as util]))

(deftest return-types
  (testing "html returns a RawString"
    (is (util/raw-string? (html [:div]))))
  (testing "converting to string"
    (= (str (html [:div])) "<div></div>")))
deps-app/versions
(ns jarkeeper.utils
  (:require
    [hiccup.page :as page]
    [hiccup2.core :refer [html]]
    [compojure.response])
  (:import (hiccup.util RawString)))

(extend-protocol compojure.response/Renderable
  RawString
  (render [body request]
    (compojure.response/render
      (str body)
      request)))