Reputation: 46480
I'm having trouble getting a non-breaking space into HTML via ClojureScript.
If I use " " the string is simply printed literally.
I'm using the Crate library.
Upvotes: 12
Views: 2845
Reputation: 3961
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 " ")
Upvotes: 23
Reputation: 46480
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  :
\u00A0
.
Upvotes: 8