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

Beautify HTML: Setting inline JS and CSS to stay unformatted #383

Closed
teodragovic opened this issue Jan 12, 2014 · 2 comments
Closed

Beautify HTML: Setting inline JS and CSS to stay unformatted #383

teodragovic opened this issue Jan 12, 2014 · 2 comments
Milestone

Comments

@teodragovic
Copy link

I have some inline javascript inside my HTML that I want to keep condensed so I added <script> tag to my unformatted list but code inside tags still comes out "beautified" (same happens with <style>).

I did some poking around and this gets easily fixed when I change order of if statements:
https://github.com/einars/js-beautify/blob/master/js/lib/beautify-html.js#L405-L426

Now I can add script and style tags to unformatted list if I want to.

So I was wondering is current behavior intended or should I make pull request?

@aljimenez
Copy link

I've noticed this problem too. I don't think that the current behavior is intended, and Teo's solution of moving the this.is_unformatted(tag_check, unformatted) condition above the tag_check === 'script' condition solves the problem.

@bitwiseman
Copy link
Member

#494 is attempting to address this. Looks likely it will happen soon.

@bitwiseman bitwiseman added this to the v1.5.2 milestone Sep 12, 2014
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

3 participants