Skip to content

chore: remove parser.template_untrimmed #16511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shiny-berries-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

chore: remove `parser.template_untrimmed`
7 changes: 0 additions & 7 deletions packages/svelte/src/compiler/phases/1-parse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ export class Parser {
*/
template;

/**
* @readonly
* @type {string}
*/
template_untrimmed;

/**
* Whether or not we're in loose parsing mode, in which
* case we try to continue parsing as much as possible
Expand Down Expand Up @@ -67,7 +61,6 @@ export class Parser {
}

this.loose = loose;
this.template_untrimmed = template;
this.template = template.trimEnd();

let match_lang;
Expand Down
8 changes: 0 additions & 8 deletions packages/svelte/src/compiler/phases/1-parse/state/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,6 @@ export default function element(parser) {
// ... or we're followed by whitespace, for example near the end of the template,
// which we want to take in so that language tools has more room to work with
parser.allow_whitespace();
if (parser.index === parser.template.length) {
while (
parser.index < parser.template_untrimmed.length &&
regex_whitespace.test(parser.template_untrimmed[parser.index])
) {
parser.index++;
}
}
}
}
}
Expand Down
Loading