Open maurice-schleussinger opened 9 years ago
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 notifications@github.com 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 https://github.com/jdc0589/JsFormat/issues/156.
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...
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 < notifications@github.com> 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 https://github.com/jdc0589/JsFormat/issues/156#issuecomment-153062425.
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:
@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).
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.