- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 47
 
Open
Description
Plugin Version
3.2.0
Prettier Version
3.3.3
Which frameworks are affected?
- none
 - vue
 - angular
 - svelte
 
Node Version
21.7.2
Which operating systems have you used?
- Linux
 - macOS
 - Windows
 
Prettier config
export default {
  plugins: ["@prettier/plugin-pug"],
  htmlWhitespaceSensitivity: "css",
  printWidth: 80,
  arrowParens: "avoid",
  bracketSameLine: false,
  semi: true,
  tabWidth: 2,
  useTabs: false,
  endOfLine: "auto",
  trailingComma: "es5",
  vueIndentScriptAndStyle: false,
  pugAttributeSeparator: "as-needed",
  pugFramework: "vue",
};Input
h2 Link: 
  a(href="") Clicknote trailing space "Link: "
Output or Error
h2 Link:
  |
  a(href="") Clicknote trailing space is removed "Link:" and pipe doesn't have it either!
Expected Output
h2 Link:
  | 
  a(href="") Click
//- or perhaps 
h2
  | Link:
  |
  a(href=“”) Clicknote trailing space after pipe "| " - the intended behavior
OR
Probably better move the text into child pipe and insert an extra pipe for that space
Additional Context
Prettier alters the result of the template which is not intended. Please look at https://pugjs.org/language/plain-text.html#whitespace-control
Also it doesn't respect htmlWhitespaceSensitivity: "strict" option and still removes any extra whitespace
Metadata
Metadata
Assignees
Labels
No labels