gh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating the code block (#119355)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Aya Elsayed 2024-05-22 06:56:35 +01:00 committed by GitHub
parent e6572e8f98
commit 5091c4400c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 79 additions and 9 deletions

View file

@ -259,7 +259,7 @@ class HistoricalReader(Reader):
self.transient_history[self.historyi] = self.get_unicode()
buf = self.transient_history.get(i)
if buf is None:
buf = self.history[i]
buf = self.history[i].rstrip()
self.buffer = list(buf)
self.historyi = i
self.pos = len(self.buffer)