prettier-vscode icon indicating copy to clipboard operation
prettier-vscode copied to clipboard

Add support for thymeleaf custom html tags/blocks

Open dimaslanjaka opened this issue 1 year ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. I develop spring boot with thymeleaf engine using VSCode+Redhat Java. in thymeleaf has new element blocks like <th:block> (https://stackoverflow.com/a/68204022/6404439)

my prettierrc.json

{
  "$schema": "https://json.schemastore.org/prettierrc",
  "printWidth": 120,
  "tabWidth": 2,
  "useTabs": false,
  "bracketSameLine": true,
  "bracketSpacing": true,
  "semi": true,
  "singleQuote": true,
  "trailingComma": "none",
  "endOfLine": "lf",
  "quoteProps": "as-needed",
  "htmlWhitespaceSensitivity": "css",
  "singleAttributePerLine": true,
  "overrides": [
    {
      "excludeFiles": [
        "*.min.js",
        "*.min.css",
        "*.min.html",
        "*.min.scss"
      ],
      "files": [
        "*.js",
        "*.css",
        "*.sass",
        "*.html",
        "*.md",
        "*.ts"
      ],
      "options": {
        "semi": true
      }
    },
    {
      "files": [
        "*.ejs",
        "*.html"
      ],
      "options": {
        "parser": "html"
      }
    }
  ]
}

Describe the solution you'd like I want format the html using Prettier VSCode Plugin.

Additional context

error while formatting custom html tags <th:block/> image image

successful without custom blocks image

dimaslanjaka avatar Feb 01 '24 15:02 dimaslanjaka