builder: lib: subscript.py: SubScript: fix dollar escape

Signed-off-by: BigfootACA <bigfoot@classfun.cn>
This commit is contained in:
BigfootACA 2024-05-24 00:36:36 +08:00
parent e49f667db9
commit 11ee7f3517

View File

@ -82,7 +82,8 @@ class SubScript:
last = content.find("$", last) last = content.find("$", last)
if last < 0: break if last < 0: break
if content[last:last + 2] == "$$": if content[last:last + 2] == "$$":
last += 2 content = content[:last] + content[last + 1:]
last += 1
continue continue
if len(content) <= last + 2 or content[last + 1] != "{": if len(content) <= last + 2 or content[last + 1] != "{":
raise ValueError(f"unexpected token in subscript at {lvl}") raise ValueError(f"unexpected token in subscript at {lvl}")