1

What I am trying to do (using gulp-pug, that uses pugjs):

<?='test!'?>
input(type='hidden', name="!{'<?=CMS::cmsQueryParam?>'}", value='loginForm')

and what ever I could find on the pug interpolation page, but it always gives me something like this:

test!
<input type="hidden" name="!{'&lt;?=CMS::cmsQueryParam?&gt;'}" value="loginForm">

Same happens here:

input(type='text', name='user', placeholder='Username', autofocus='', value="<?=$_REQUEST['user']?>")

.. the will be converted to html entities. I have no clue how to prevent this.

Any ideas? Know of any posts, this could be a duplicate from?

BananaAcid
  • 3,221
  • 35
  • 38

1 Answers1

2

Buffered code can be unescaped by starting with !=. e.g.

!= "<?='test!'?>"

Values for tag/mixin arguments can be unescaped by assigning with != instead of =. e.g.

input(type='hidden', name!="<?=CMS::cmsQueryParam?>", value='loginForm')

input(type='text', name='user', placeholder='Username', autofocus='', value!="<?=$_REQUEST['user']?>")
Oluwafemi Sule
  • 36,144
  • 1
  • 56
  • 81