wufan commited on
Commit
20abfc4
1 Parent(s): 1d3853f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -68,6 +68,7 @@ template_html = """<!DOCTYPE html>
68
  """
69
 
70
  def latex2html(latex_code):
 
71
  latex_code = latex_code.replace('\left(', '(').replace('\\right)', ')').replace('\left[', '[').replace('\\right]', ']').replace('\left{', '{').replace('\\right}', '}').replace('\left|', '|').replace('\\right|', '|').replace('\left.', '.').replace('\\right.', '.')
72
 
73
  latex_code = latex_code.replace('"', '``').replace('$', '')
@@ -78,7 +79,6 @@ def latex2html(latex_code):
78
  gt += '"' + out.replace('\\', '\\\\') + r'\n' + '"' + '+' + '\n'
79
 
80
  gt = gt[:-2]
81
- gt = "\\[" + gt + "\\]"
82
 
83
  lines = template_html.split("const text =")
84
  new_web = lines[0] + 'const text =' + gt + lines[1]
 
68
  """
69
 
70
  def latex2html(latex_code):
71
+ latex_code = '\\[' + latex_code + '\\]'
72
  latex_code = latex_code.replace('\left(', '(').replace('\\right)', ')').replace('\left[', '[').replace('\\right]', ']').replace('\left{', '{').replace('\\right}', '}').replace('\left|', '|').replace('\\right|', '|').replace('\left.', '.').replace('\\right.', '.')
73
 
74
  latex_code = latex_code.replace('"', '``').replace('$', '')
 
79
  gt += '"' + out.replace('\\', '\\\\') + r'\n' + '"' + '+' + '\n'
80
 
81
  gt = gt[:-2]
 
82
 
83
  lines = template_html.split("const text =")
84
  new_web = lines[0] + 'const text =' + gt + lines[1]