Atom-beautify can not format js in html


#1

The code in js can be formatted correctly

but the code in html can not be formatted correctly

image

Is there any problem with it?


#3

Hello.

Have you visited the package’s web page yet?
https://atom.io/packages/atom-beautify

You might find it worth to look at it, as there is a section that handles what you ask.
There is a little demo video also.
An extract of the text follows -




Going one step further -
The command atom-beautify:beautify-language-JavaScript can be triggered in Atom user’s script file init.coffee. The script can do the following:

  1. Trigger the beautify task for the whole HTML.

  2. Select all the lines containing JS.

  3. Trigger the beautify task for the selected JS.

  4. Deselect all the selections.

  5. Optional: save the file.

The above is guess work from a novice. I have a high confidence that it could work.

What are your thoughts?
- Dan


Specifying different grammars for an extension, one for the code editor (syntax highlighting) and another for Atom Beautify
#4

Just the scirpt tags.


#5

sorry. My mistake

If I use script or script type=“text/javascript”,It works.

But if I use script type=“text/babel” , it does not work.

Atom-beautify can not discern the script type=“text/babel” ?


#6

I guess not.