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

Support formatting of inline javascript in HTML files #156

Open
maurice-schleussinger opened this issue Nov 2, 2015 · 5 comments
Open
Labels

Comments

@maurice-schleussinger
Copy link

It would be nice to be able to format inline javascript in HTML files by selecting a code block and pressing a key combination or entering a command in the command palette.

@jdavisclark
Copy link
Owner

i would be ok with this. you used to be able to do this, but too many
people tried to format the whole file, which obviously screwed up html
content.

I dont want to start doing any html parsing right now though. So, we
would need to only allow formatting of highlighted code in html files.

On Mon, Nov 2, 2015, 9:38 AM Maurice Schleußinger [email protected]
wrote:

It would be nice to be able to format inline javascript in HTML files by
selecting a code block and pressing a key combination or entering a command
in the command palette.


Reply to this email directly or view it on GitHub
#156.

@maurice-schleussinger
Copy link
Author

Well people should be able to decide themselves when to use the formatter, right (not talking about format-on-save)? If they do it wrong manually, undo is just a step away...

@jdavisclark
Copy link
Owner

agreed, but I don't see a reason to ever allow formatting an entire
html file without a selection (feel free to correct me if I'm missing something though).

Ideally, we could parse out javascript tags from the current html file and
format all of those, but I'm not sure if I want to do that right now.

On Mon, Nov 2, 2015 at 10:02 AM Maurice Schleußinger <
[email protected]> wrote:

Well people should be able to decide themselves when to use the formatter,
right (not talking about format-on-save)? If they do it wrong manually,
undo is just a step away...


Reply to this email directly or view it on GitHub
#156 (comment).

@maurice-schleussinger
Copy link
Author

i would be ok with this. you used to be able to do this, but too many
people tried to format the whole file, which obviously screwed up html
content.

How about just allowing it via the command palette then?

HTMLBeautify allows formatting of select text like this:

screenshot 2016-05-24 15 32 04

@jdavisclark
Copy link
Owner

@M4urice I think I'm ok with that. It also solves the problem of quickly formatting some throw-away content being a 2-step process (set syntax, format).

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

No branches or pull requests

2 participants