POLRAMBORA commited on
Commit
beb2493
·
verified ·
1 Parent(s): 0d6e774

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -139,19 +139,25 @@ def render_message(history):
139
  messages_html += """
140
  </div>
141
  </div>
 
 
 
 
 
 
 
142
  <script>
143
- // Trigger MathJax rendering
144
- function processMath() {
145
  if (typeof MathJax !== 'undefined') {
146
  MathJax.typeset();
147
  }
148
- }
149
- processMath();
150
  </script>
151
  """
152
 
153
  return messages_html
154
 
 
155
  js = """
156
  function processMath() {
157
  if (typeof MathJax !== 'undefined') {
 
139
  messages_html += """
140
  </div>
141
  </div>
142
+
143
+ <!-- MathJax Script -->
144
+ <script type="text/javascript" id="MathJax-script" async
145
+ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js">
146
+ </script>
147
+
148
+ <!-- Trigger MathJax Typeset -->
149
  <script>
150
+ document.addEventListener("DOMContentLoaded", function() {
 
151
  if (typeof MathJax !== 'undefined') {
152
  MathJax.typeset();
153
  }
154
+ });
 
155
  </script>
156
  """
157
 
158
  return messages_html
159
 
160
+
161
  js = """
162
  function processMath() {
163
  if (typeof MathJax !== 'undefined') {