Don't add chaperone space after escaped quote in triple quote (#17216)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
Max Mynter
2025-04-11 10:21:47 +02:00
committed by GitHub
parent 1a3b73720c
commit 1aad180aae
5 changed files with 307 additions and 11 deletions

View File

@@ -372,7 +372,7 @@ impl Format<PyFormatContext<'_>> for FormatLiteralContent {
Cow::Owned(normalized) => text(normalized).fmt(f)?,
}
if self.trim_end && needs_chaperone_space(self.flags, &normalized) {
if self.trim_end && needs_chaperone_space(self.flags, &normalized, f.context()) {
space().fmt(f)?;
}
}