html2jade icon indicating copy to clipboard operation
html2jade copied to clipboard

fix script & style indentations

Open donpark opened this issue 14 years ago • 2 comments

Jade is rather uptight about indentation of contents of CDATA tags like script and style tags so, unless rules are loosened, script and style tag contents will have to be reformatted during conversion. Support for non-JS script tag will be problematic, however.

donpark avatar Apr 26 '11 22:04 donpark

For javascript at least, possibly pass it through something like https://github.com/einars/js-beautify. And for css: https://github.com/senchalabs/cssbeautify.

Just have to go through and see which library fits best, as well as decide if the extra dependency is worth it.

thenoviceoof avatar Dec 03 '12 20:12 thenoviceoof

Using beautifier you mentioned is a good idea. Re dependency, given that html2jade is typically used as CLI tool, moderately heavy dependents are OK I think.

Alternate way of supporting beautifier is using CLI tools as plugins of sort. So for JS, html2jade can attempt to launch html2jade-js process via a shell instance and pipe content of CDATA through it. Same with CSS.

donpark avatar Dec 03 '12 20:12 donpark