0

试图添加一个— 在两个 div 之间使用 Enlive 但是

           {:tag :span,
             :attrs {:class "mdash"},
             :content "—"}

只返回实际文本 & mdash; 而不是画一个——

想法?

4

1 回答 1

0

Enlive 会因为 normal 逃脱&(content some-string)因为这是一个理智的默认设置。

要设置原始 HTML 内容和转义字符,请使用html-content,它html-snippet在后台使用。

例子

(html/html-snippet "&mdash;<p>hello</p>")

("—" {:tag :p,
      :attrs nil, 
      :content ("hello")})
于 2015-08-26T16:01:29.520 回答