summaryrefslogtreecommitdiff
path: root/pygments/lexers/python.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/python.py')
-rw-r--r--pygments/lexers/python.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
index 7540489c..ba037eb3 100644
--- a/pygments/lexers/python.py
+++ b/pygments/lexers/python.py
@@ -172,19 +172,19 @@ class PythonLexer(RegexLexer):
# without format specifier
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
r'(\![sraf])?' # conversion
- r'}', String.Interpol, '#pop'),
+ r'\}', String.Interpol, '#pop'),
# with format specifier
# we'll catch the remaining '}' in the outer scope
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
r'(\![sraf])?' # conversion
r':', String.Interpol, '#pop'),
- (r'[^\S]+', Text), # allow new lines
+ (r'\s+', Text), # allow new lines
include('expr'),
],
'expr-inside-fstring-inner': [
(r'[{([]', Punctuation, 'expr-inside-fstring-inner'),
(r'[])}]', Punctuation, '#pop'),
- (r'[^\S]+', Text), # allow new lines
+ (r'\s+', Text), # allow new lines
include('expr'),
],
'expr-keywords': [
@@ -317,8 +317,8 @@ class PythonLexer(RegexLexer):
default('#pop'),
],
'fstringescape': [
- ('{{', String.Escape),
- ('}}', String.Escape),
+ (r'\{\{', String.Escape),
+ (r'\}\}', String.Escape),
include('stringescape'),
],
'stringescape': [