mohd-akram / html-format

A Node.js library for formatting HTML strings

Home Page:https://www.npmjs.com/package/html-format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for disabling formatter on specific lines, please

anion155 opened this issue · comments

aka

<div>
  <!-- html-format disable -->
  <script>very-ling-minified-js-for-example</script>
  <!-- html-format enable -->
</div>

I don't believe we format script tags in the first place. What behavior do you get?

Well currently it's about minified scripts like TiktokAnalyticsObject snippet gets formatted after saving. I will look if I can disable it by js formatters. But it would be nice to have same functionality for html tags

Are you using html-format through the VS Code extension? My extension does not format JS, you might have VS Code's HTML formatting turned on instead. You can specify the formatter via settings.json:

"[html]": {
  "editor.defaultFormatter": "mohd-akram.vscode-html-format"
}

The default one is called vscode.html-language-features. The docs for it are here.