Skip to content

Commit

Permalink
improve re efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-husky committed Jul 24, 2023
1 parent c2701c9 commit 56bb8b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crazy_functions/latex_fns/latex_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def split_subprocess(txt, project_folder, return_dict, opts):
mask = np.zeros(len(txt), dtype=np.uint8) + TRANSFORM

# 吸收title与作者以上的部分
text, mask = set_forbidden_text(text, mask, r"(.*?)\\maketitle", re.DOTALL)
text, mask = set_forbidden_text(text, mask, r"^(.*?)\\maketitle", re.DOTALL)
text, mask = set_forbidden_text(text, mask, r"^(.*?)\\begin{document}", re.DOTALL)
# 吸收iffalse注释
text, mask = set_forbidden_text(text, mask, r"\\iffalse(.*?)\\fi", re.DOTALL)
# 吸收在42行以内的begin-end组合
Expand Down

0 comments on commit 56bb8b6

Please sign in to comment.