Talesoft / tale-jade

A complete and fully-functional implementation of the Jade template language for PHP
http://jade.talesoft.codes
MIT License
88 stars 10 forks source link

Using text block (.) inside an if makes if swallow everything ahead #42

Closed svallory closed 8 years ago

svallory commented 8 years ago

Example:

  if ($noscript)
    script.
      // The next p shouldn't be inside this if

  p

output:

<?php if (isset($noscript) ? $noscript : false) {?>
  <script>
    // The next p shouldn't be inside this if
  </script>
  <p></p>
<?php }?>
elquimista commented 8 years ago

This is surely a problem. Just confirmed it on Tale Jade Sandbox.

TorbenKoehn commented 8 years ago

This is indeed a huge problem.

I'll take a look at it right away.

TorbenKoehn commented 8 years ago

As a quick workaround, it seems this one: http://sandbox.jade.talesoft.io/id-5698348a1961d.html seems to parse correctly.

This one http://sandbox.jade.talesoft.io/id-5698352a98568.html doesn't.

I'm on it.

Edit: Also noticed that the live compiler could need a fucking save-function.

TorbenKoehn commented 8 years ago

Can you check if this has been fixed for you?

elquimista commented 8 years ago

Seems this issue is fixed now.

svallory commented 8 years ago

It works! :)

TorbenKoehn commented 8 years ago

Awesome! Thanks for your feedback :)