express - Jade render's my html twice -


maybe i'm asking question wrong since seems answer should relatively easy search for. parsing .md files in express , returning response jade template.

= body returns <h1>my content</h1> string.
#{body} returns &lt;<h1>my content</h1>&gt;<!--<h1-->my content&gt; or effectively:

< content #as styled h1  >my content> 

thanks help.

update clarity: question - why content returning twice.

why content returning twice.

because syntax of #{variable} jade replace variable value , interpret html tag. example:

passing local variable {foo: 'bar'} , template

#{foo} 

generat html

<bar></bar> 

so should pass content , don't let interpret jade using = or != unbuffered code:

!=body 

btw: whitespace forbidden between = , variable!


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -