Question

I have defined a template in this way:

(deftemplate layout-string "path/to/html/container.html"
  [content-strings]
  [:#container :> :div.pad]  (content (html-snippet (apply str content-strings)))
)

Here content-strings contain a HTML (for example: "<tr><td><a href="mylink">my link</a></td></tr>) Unfortunately this doesn't work. Instead it's removing the <tr> and the <td> leaving only the <a> tag. I've tried with different approach (with different unsuccessful results). Any help would be very welcome!

Was it helpful?

Solution

html-content is the function you need. However it's bad performance-wise. Where does this html string come from?

EDIT: example

=> (sniptest "<div>"
     [:div] (html-content "<tr><td><a href=\"mylink\">my link</a></td></tr>"))
"<div><tr><td><a href=\"mylink\">my link</a></td></tr></div>"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top