mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-04 22:27:29 +00:00
Improved instruct style (with syntax highlighting & LaTeX rendering) (#5936)
This commit is contained in:
parent
9c04365f54
commit
6761b5e7c6
74 changed files with 1358 additions and 51 deletions
|
|
@ -57,6 +57,14 @@ def convert_to_markdown(string):
|
|||
# Code
|
||||
string = string.replace('\\begin{code}', '```')
|
||||
string = string.replace('\\end{code}', '```')
|
||||
string = string.replace('\\begin{align*}', '$$')
|
||||
string = string.replace('\\end{align*}', '$$')
|
||||
string = string.replace('\\begin{align}', '$$')
|
||||
string = string.replace('\\end{align}', '$$')
|
||||
string = string.replace('\\begin{equation}', '$$')
|
||||
string = string.replace('\\end{equation}', '$$')
|
||||
string = string.replace('\\begin{equation*}', '$$')
|
||||
string = string.replace('\\end{equation*}', '$$')
|
||||
string = re.sub(r"(.)```", r"\1\n```", string)
|
||||
|
||||
result = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue