Answer the question
In order to leave comments, you need to log in
Can PUG be used with regular HTML syntax?
Good morning. I found out right now that PUG understands regular HTML syntax and the question is: "Can I use PUG with regular HTML syntax?"
In general, I like PUG, many people know it, so there are fewer problems with support if the project gets to someone else, but I don’t like the indented syntax, but all sorts of conditions, includes, loops, etc. they are good enough.
Actually the main question: Is it possible to mix the syntax? All html should be written in the usual syntax, but the constructions of conditions, cycles in the PUG syntax?
Example:
- var user = { description: 'foo bar baz' }
- var authorised = false
<div id="user">
if user.description
<h2 class="green">Description</h2>
<p class="description">#{user.description}</p>
else if authorised
<h2 class="blue">Description</h2>
<p class="description">User has no description, why not add one...</p>
else
<h2 class="red">Description</h2>
<p class="description">User has no description</p>
</div>
Answer the question
In order to leave comments, you need to log in
Well, if so, then I would use react, and not crutches that mimic it ..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question