Skip to content

Commit

Permalink
fix: off-by-one bug in HTML whitespace removal (#14589)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian authored Oct 12, 2023
1 parent 0a38e3b commit f54e6d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
node.sourceCodeLocation!.startOffset -
node.sourceCodeLocation!.startCol
const line = s.slice(
lineStartOffset,
Math.max(0, lineStartOffset),
node.sourceCodeLocation!.startOffset,
)

Expand Down

0 comments on commit f54e6d8

Please sign in to comment.