mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-27 08:55:39 +00:00
[#5277] [desktop] escape html tags in messages
This commit is contained in:
parent
44fbe62773
commit
f3f476fa89
@ -92,11 +92,17 @@
|
|||||||
(vec (map string/upper-case ts))
|
(vec (map string/upper-case ts))
|
||||||
ts))
|
ts))
|
||||||
|
|
||||||
|
(defn escape-html [text]
|
||||||
|
(if (and platform/desktop? (string? text))
|
||||||
|
(clojure.string/escape text {\< "<", \> ">", \& "&"})
|
||||||
|
text))
|
||||||
|
|
||||||
(defn text
|
(defn text
|
||||||
([t]
|
([t]
|
||||||
[text-class t])
|
[text-class (escape-html t)])
|
||||||
([opts t & ts]
|
([opts t & ts]
|
||||||
(->> (conj ts t)
|
(->> (conj ts t)
|
||||||
|
(map escape-html)
|
||||||
(transform-to-uppercase opts)
|
(transform-to-uppercase opts)
|
||||||
(concat [text-class (add-font-style :style opts)])
|
(concat [text-class (add-font-style :style opts)])
|
||||||
(vec))))
|
(vec))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user