maizzle / framework

Quickly build HTML emails with Tailwind CSS.
https://maizzle.com
MIT License
1.24k stars 49 forks source link

Text nodes right after condition don't render #269

Closed ma7moudat closed 4 years ago

ma7moudat commented 4 years ago

If the condition in an <if> tag isn't met and the content after it isn't wrapped in an HTML tag, it doesn't render.

Reproduction:

<if condition="0 === 1">
  This won't render.
</if>
<div>This will render.</div>

<if condition="0 === 1">
  This won't render.
</if>
This should render.

Expected Output

<div>This will render.</div>

This should render.

Actual Output

<div>This will render.</div>
cossssmin commented 4 years ago

It's a posthtml-expressions issue that we've yet to fix.

For now, a workaround is to use the <raw> tag:

<if condition="0 === 1">
  This won't render.
</if>
<raw>
  This should render.
</raw>
ma7moudat commented 4 years ago

@cossssmin thanks, raw is a sufficient workaround for me

cossssmin commented 4 years ago

This should now be fixed in 1.4.2, please update and give it a try. Feel free to reopen if you're still encountering issues.