jdavisclark / JsFormat

Javascript formatting for Sublime Text 2 & 3
1.42k stars 222 forks source link

Indent multi-line annotation each command in html? #163

Closed pingfengafei closed 7 years ago

pingfengafei commented 8 years ago

Here is a section in my html file, format manually : image

after command: image

jsformat indent uncorrectly.

here is my user config:

{
    // exposed jsbeautifier options
    "indent_with_tabs": true,
    "preserve_newlines": true,
    "max_preserve_newlines": 4,
    "space_in_paren": false,
    "jslint_happy": false,
    "brace_style": "collapse",
    "keep_array_indentation": false,
    "keep_function_indentation": false,
    "eval_code": false,
    "unescape_strings": false,
    "break_chained_methods": false,
    "e4x": false,
    "wrap_line_length": 0,

    // jsformat options
    "format_on_save": false,
    "format_selection": true,
    "jsbeautifyrc_files": false,
    "ignore_sublime_settings": true,
    "format_on_save_extensions": ["js", "json"]
}

How to solve it ?

jdavisclark commented 7 years ago

JsFormat isn't really intended to be used on html files. If you really want use it in html files, you can highlight the contents of your script tag (including leading whitespace on the first line), and it will just format the selection.