posthtml / posthtml-expressions

Use variables, JS-like expressions, and even markup-powered logic in your HTML.
Other
123 stars 20 forks source link

if/elseif fails if there's an HTML comment between the tags #150

Open cossssmin opened 1 year ago

cossssmin commented 1 year ago

Consider the code:

<if condition="1">
  Foo
</if>
<!-- Comment -->
<elseif condition="0">
  Bar
</elseif>

It should display Foo, but instead it displays Foo Bar.

When HTML comment is removed it works as expected.

Originally reported in maizzle/framework#982 by @vkovic.