0

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?

sova
  • 5,468
  • 10
  • 40
  • 48

1 Answers1

0

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 "&mdash;<p>hello</p>")

("—" {:tag :p,
      :attrs nil, 
      :content ("hello")})
claj
  • 5,172
  • 2
  • 27
  • 30