Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions von/strparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def demacro(text: str) -> str:


def remove_soft_newlines(text: str) -> str:
strip_text = "\n".join(line.lstrip() for line in text.splitlines())
return re.sub(
r"[a-zA-Z.,;—\"–'):$]\n[a-zA-Z$'\"]",
lambda m: m.group(0).replace("\n", " "),
text,
strip_text,
)


Expand Down Expand Up @@ -118,8 +119,8 @@ def toAOPS(text: str) -> str:
"\n\n" + "[b][color=red]" + env.title() + ":[/color][/b] ",
)
text = text.replace(r"\end{" + env + "}", "")
text = text.replace(r"\begin{proof}", "[i]Proof.[/i] ")
text = text.replace(r"\end{proof}", r"$\blacksquare$" + "\n")
text = text.replace("\\begin{proof}\n", "[i]Proof.[/i] ")
text = text.replace("\n\\end{proof}", r" $\blacksquare$" + "\n")
text = text.replace(r"\bigskip", DIVIDER)
text = text.replace(r"\medskip", DIVIDER)
text = text.replace(r"\#", "#")
Expand Down