0

& mdash; を追加しようとしています。Enliveを使用して2つのdivの間ですが、

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

実際のテキストを返すだけです & mdash; を描く代わりに —

考え?

4

1 に答える 1

0

Enlive は&、通常(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 に答える