Skip to content

Commit ea75621

Browse files
authored
Oops, that still eats it
1 parent 50700cc commit ea75621

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

script.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ def parse_text(text: str) -> str:
6969

7070
def highlight_text(matches: re.Match[str]) -> str:
7171
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])
7676
)
7777

7878

@@ -205,8 +205,8 @@ def process_line(
205205
) -> str:
206206
# Highlight localized strings
207207
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),
210210
line,
211211
flags=re.IGNORECASE
212212
)

0 commit comments

Comments
 (0)