prettier / prettier-vscode

Visual Studio Code extension for Prettier
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
MIT License
5.14k stars 454 forks source link

<<!-- prettier-ignore-start/end --> not working #1596

Closed jlongo closed 3 years ago

jlongo commented 3 years ago

I'm trying to ignore block of code in htm file with <!-- prettier-ignore-start --> and <!-- prettier-ignore-end -->

Not working at all, i get the same result with or without the tags...

This

<!-- prettier-ignore-start -->
description = "xxxxxxxxxxxx" 
[cookieConsent] 
message = "Este espaço utiliza \"cookies\" para melhorar a sua experiência de navegação." 
dismiss = "Concordo" 
learnMore = "Informações adicionais" 
link = "/informacao-sobre-cookies" 
theme = "dark-bottom" 
[SeoCmsPage] 
==
<!-- prettier-ignore-end -->

is transformed in:

<!-- prettier-ignore-start -->
description = "xxxxxxxxxxxx" [cookieConsent] message = "Este espaço utiliza \"cookies\" para
melhorar a sua experiência de navegação." dismiss = "Concordo" learnMore = "Informações adicionais" link =
"/informacao-sobre-cookies" theme = "dark-bottom" [SeoCmsPage] ==
<!-- prettier-ignore-end -->

Prettier log

["INFO" - 23:32:27] Formatting w:\xxxx\xxx.htm
["INFO" - 23:32:27] Using ignore file (if present) at w:\xxxx\.prettierignore
["INFO" - 23:32:27] Using bundled version of prettier.
["INFO" - 23:32:27] File Info:
{
  "ignored": false,
  "inferredParser": "html"
}
["INFO" - 23:32:27] No local configuration (i.e. .prettierrc or .editorconfig) detected, falling back to VS Code configuration
["INFO" - 23:32:27] Prettier Options:
{
  "arrowParens": "always",
  "bracketSpacing": true,
  "endOfLine": "lf",
  "htmlWhitespaceSensitivity": "css",
  "insertPragma": false,
  "jsxBracketSameLine": false,
  "jsxSingleQuote": false,
  "printWidth": 120,
  "proseWrap": "preserve",
  "quoteProps": "as-needed",
  "requirePragma": false,
  "semi": true,
  "singleQuote": false,
  "tabWidth": 2,
  "trailingComma": "es5",
  "useTabs": false,
  "vueIndentScriptAndStyle": false,
  "filepath": "w:\\xxxx\\xxx.htm",
  "parser": "html"
}
["INFO" - 23:32:27] Formatting completed in 459.227699ms.

Forget to say: version 5.7.1

TIA JL

jlongo commented 3 years ago

It seems only to work with markdown :( I close it

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.