Fix regex in extract
This commit is contained in:
parent
6f38cad661
commit
5c6aac9ed9
1 changed files with 1 additions and 1 deletions
|
|
@ -2673,7 +2673,7 @@ def elongateCharacters(text):
|
|||
def extractTranslation(translatedTextList, is_list):
|
||||
try:
|
||||
translatedTextList = re.sub(r'\\"+\"([^,\n}])', r'\\"\1', translatedTextList)
|
||||
translatedTextList = re.sub(r'(?<![\\])"+', r'"', translatedTextList)
|
||||
translatedTextList = re.sub(r'(?<![\\])\"+(?!\n)', r'"', translatedTextList)
|
||||
line_dict = json.loads(translatedTextList)
|
||||
# If it's a batch (i.e., list), extract with tags; otherwise, return the single item.
|
||||
string_list = list(line_dict.values())
|
||||
|
|
|
|||
Loading…
Reference in a new issue