mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-26 16:39:24 +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))
|
||||
ts))
|
||||
|
||||
(defn escape-html [text]
|
||||
(if (and platform/desktop? (string? text))
|
||||
(clojure.string/escape text {\< "<", \> ">", \& "&"})
|
||||
text))
|
||||
|
||||
(defn text
|
||||
([t]
|
||||
[text-class t])
|
||||
[text-class (escape-html t)])
|
||||
([opts t & ts]
|
||||
(->> (conj ts t)
|
||||
(map escape-html)
|
||||
(transform-to-uppercase opts)
|
||||
(concat [text-class (add-font-style :style opts)])
|
||||
(vec))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user