Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix script & style indentations #9

Open
donpark opened this issue Apr 26, 2011 · 2 comments
Open

fix script & style indentations #9

donpark opened this issue Apr 26, 2011 · 2 comments

Comments

@donpark
Copy link
Owner

donpark commented Apr 26, 2011

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.

@thenoviceoof
Copy link

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.

@donpark
Copy link
Owner Author

donpark commented Dec 3, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants