Issue
we use pug to compile .pug file into .xml file.
one of xml file are using <when></when>
but when I try to add
p
when #{when}
pug said when is keyword and syntax is error.
How could I escape keyword when
in pug file as normal tag like h1
or p
?
Solution
You can use interpolation, like this:
- let when = 'foo'
p
#{'when'} #{when}
Which compiles to this:
<p>
<when>foo</when>
</p>
Answered By - Sean Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.