Pug render variable twice


recently, I want to pass this variable to the view

passedVars.metaOgUrl = '<meta property="og:url" content="' + originalUrl + '">';

and use the usual way of rendering variable in pug

#{metaOgUrl}

but it render the tag twice, a simple googling then found the answer, use != character as prefix

!=metaOgUrl

it’s rendered normal now

 

source:

https://stackoverflow.com/questions/23076881/jade-renders-my-html-twice

 

Advertisements