fix HTML-escaped space padding in notebook (#1506)

This commit is contained in:
melnikovsky 2023-09-06 21:16:29 +03:00 committed by Casper da Costa-Luis
parent ee94a1c69d
commit bda614a39b
No known key found for this signature in database
GPG Key ID: F5126E5FBD2512AD
1 changed files with 2 additions and 0 deletions

View File

@ -157,6 +157,8 @@ class tqdm_notebook(std_tqdm):
pbar.value = self.n pbar.value = self.n
if msg: if msg:
# take care of space padding in html
msg=msg.translate({ord(' ') : u'\u2007'})
# html escape special characters (like '&') # html escape special characters (like '&')
if '<bar/>' in msg: if '<bar/>' in msg:
left, right = map(escape, re.split(r'\|?<bar/>\|?', msg, maxsplit=1)) left, right = map(escape, re.split(r'\|?<bar/>\|?', msg, maxsplit=1))