ClojureScript and HTML entities

为君一笑 提交于 2019-11-30 18:38:53

Google's closure library that clojurescript leverages includes string helpers that will allow you to expand HTML entities.

(require '[goog.string :as gstring])
(gstring/unescapeEntities " ")

Got it after reading:

https://github.com/ibdknox/crate/issues/12

Basically, the issue seems to be that Crate inserts directly into the DOM thus skipping entity expansion (please someone correct me if I've misunderstood).

One solution is to use the following string which represents the UTF for &nbsp: \u00A0.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!