prettier / prettier/plugin-pug
Bug(svelte): the closing </template> tag is moved to the after last word
Open
Nobody has claimed this yet.
framework: Svelte
type: bug
- Dominant language
- TypeScript
- Stars
- 208
- Forks
- 49
- Avg merge
- 4h 26m
- Merged PRs (30d)
- 8
Description
Info
| Tool | Version |
|---|---|
| Plugin | v3.0.0 |
| Prettier | v3.0.3 |
| Framework | svelte 4.2.0 |
| Node | v18.16.1 |
| OS | mac |
Prettier config
{
"useTabs": false,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["@prettier/plugin-pug", "prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"pugSingleQuote": false,
"pugSortAttributes": "asc",
"pugFramework": "svelte"
}
Input
<template lang="pug">
p digest
</template>
Output
<template lang="pug">
p digest</template>
Expected Output
<template lang="pug">
p digest
</template>
Additional Context
At the moment it breaks the styles highlight
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided Prettier configuration and Svelte template input. Compare the formatter output with the expected output, including the closing tag placement and preserved style highlighting. Done means the closing tag remains on its own line without regressing formatting for the shown case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pug, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100