Talesoft / tale-jade

A complete and fully-functional implementation of the Jade template language for PHP

Home Page:http://jade.talesoft.codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML minification can break inline scripts

jaydenseric opened this issue · comments

Using this jade syntax:

script.
  // JS code here...

Without pretty when rendering collapses all the line breaks in the script code without intelligent consideration for semicolons. This breaks most inline scripts if you don't use semicolons, which is valid JS and an enforced coding style in many teams (see JavaScript Standard Style).

Pug has no issues and intelligently minifies the JS inside inline scripts.

So, JSMinify on script-element's content if the compiler is in non-pretty mode? Because I probably won't implement a JavaScript-interpreter of any kind. Shouldn't be a greater problem I guess, I'll implement it.

Never noticed it because I always put the semicolon, it's a reflex haha.

Thank you for finding this :)