ClojureScript和HTML实体 [英] ClojureScript and HTML entities

查看:128
本文介绍了ClojureScript和HTML实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我使用& nbsp;这个字符串是直接打印出来的。



我使用Crate库。

解决方案

阅读后明白:



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



基本上,问题似乎是Crate直接插入DOM,从而跳过实体扩展(如果我误解了,请有人纠正我)


一种解决方案是使用下面的字符串来代表& nbsp: \\\ 


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.

解决方案

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.

这篇关于ClojureScript和HTML实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆