File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ def parse_text(text: str) -> str:
69
69
70
70
def highlight_text (matches : re .Match [str ]) -> str :
71
71
return env .get_template ('highlight/text.html' ).render (
72
- before_var = '' ,
73
- variable = matches [1 ],
74
- after_var = matches [2 ],
75
- parsed_text = parse_text (matches [1 ])
72
+ before_var = '" ' ,
73
+ variable = matches [2 ],
74
+ after_var = matches [3 ],
75
+ parsed_text = parse_text (matches [2 ])
76
76
)
77
77
78
78
@@ -205,8 +205,8 @@ def process_line(
205
205
) -> str :
206
206
# Highlight localized strings
207
207
line = re .sub (
208
- r'(?: [A-Za-z0-9_]+loc\((?:\d+, )?") ((?:[^"\\]|\\.)+)(", "[a-z0-9_-]+")\)' , # noqa: E501
209
- highlight_text ,
208
+ r'([A-Za-z0-9_]+loc\((?:\d+, )?)" ((?:[^"\\]|\\.)+)(", "[a-z0-9_-]+")\)' , # noqa: E501
209
+ lambda matches : matches [ 1 ] + highlight_text ( matches ) ,
210
210
line ,
211
211
flags = re .IGNORECASE
212
212
)
You can’t perform that action at this time.
0 commit comments