Brackets.io: Is there a way to auto indent / format <html>

前端 未结 6 1000
醉酒成梦
醉酒成梦 2021-02-02 05:35

I am new to Brackets.io and thought I saw a shortcut key to auto indent/format HTML, however I cannot find a shortcut. Is there a shortcut or add-on that will do this for me?

6条回答
  •  梦如初夏
    2021-02-02 06:21

    I've been playing around with the preferences and added the following to my brackets.json file (access in Menu Bar: Debug: "Open Preferences File").

    "closeTags": { "dontCloseTags": ["br", "hr", "img", "input", "link", "meta", "area", "base", "col", "command", "embed", "keygen", "param", "source", "track", "wbr"], "indentTags": ["ul", "ol", "div", "section", "table", "tr"], }

    • dontCloseTags are tags such as
      which shouldn't be closed.
    • indentTags are tags that you want to automatically create a new indented line - add more as needed!
    • (any tags that aren't in above arrays will self-close on the same line)

提交回复
热议问题