如何将一串 Hiccup 解析为 Hiccup 节点?
例如,
将 "[:b 'hello world']"
转换为 [:b "hello world"]
最佳答案
使用reader将字符串转换为数据结构:
user=> (clojure.edn/read-string "[:b 'hello world']")
[:b 'hello world']
您应该使用"
来表示字符串:
user=> (clojure.edn/read-string "[:b \"hello world\"]")
[:b "hello world"]
关于clojure - 如何将字符串解析为 Hiccup?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29179043/