Trying to add an & mdash; between two divs using Enlive but
{:tag :span,
:attrs {:class "mdash"},
:content "—"}
just returns the actual text & mdash; instead of drawing a —
Thoughts?
Trying to add an & mdash; between two divs using Enlive but
{:tag :span,
:attrs {:class "mdash"},
:content "—"}
just returns the actual text & mdash; instead of drawing a —
Thoughts?
Enlive will escape &
for ordinary (content some-string)
, because that's a sane default.
To set raw HTML content and escaped characters, use html-content
, which uses html-snippet
under the hood.
Example
(html/html-snippet "—<p>hello</p>")
("—" {:tag :p,
:attrs nil,
:content ("hello")})