I have an array of objects that each contain a value of raw HTML. The raw html is an oEmbed object, with javascript, css, and html in a single string.
I would like to iterate each string of raw html into css flex boxes, but can't seem to figure out how.
<! -- attempt 1 -->
div.container
h2 posts
ul.flex-container
each post in posts
li.flex-item
p!= #{post.html}
<! -- attempt 2 -->
div.container
h2 posts
ul.flex-container
each post in posts
li.flex-item
include content.html #{post.html}
<! -- attempt 3 -->
div.container
h2 posts
ul.flex-container
each post in posts
li.flex-item #{post.html}
Attempt #1 stemmed from this post. I get an Unexpected token ILLEGAL
error on the p!=
line when I tried that.
I thought I had read something that had said html was a built in filter for jade. Couldn't find it anywhere in the docs though. Attempt #2 was trying to implement it, but I think I need to have a .html file saved down. Currently the html is only stored in a variable.
Attempt #3 renders something on the page when I substitute #{post.title}
for #{post.html}
, so the error is not in the each post in posts
function.
Can jade handle a direct html write? Would I be better off trying to use document.body.innerHTML
in a function and see if I can inject it to the flex boxes that way?
Any help is greatly appreciated!