POLRAMBORA commited on
Commit
2c1402c
·
verified ·
1 Parent(s): bef5399

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -126,7 +126,7 @@ def render_message(history):
126
  for user_message, assistant_message, user_profile, assistant_profile, user_pic, assistant_pic in history:
127
  if user_message and user_message not in seen_messages:
128
  seen_messages.add(user_message)
129
- user_message_html = escape_html(user_message)
130
  messages_html += f"""
131
  <div style='display: flex; align-items: center; margin-bottom: 10px;'>
132
  <img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
@@ -135,7 +135,7 @@ def render_message(history):
135
 
136
  if assistant_message and assistant_message not in seen_messages:
137
  seen_messages.add(assistant_message)
138
- assistant_message_html = escape_html(assistant_message)
139
  messages_html += f"""
140
  <div style='display: flex; align-items: center; margin-bottom: 10px;'>
141
  <img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
 
126
  for user_message, assistant_message, user_profile, assistant_profile, user_pic, assistant_pic in history:
127
  if user_message and user_message not in seen_messages:
128
  seen_messages.add(user_message)
129
+ user_message_html = markdown.markdown(escape_html(user_message), extensions=["fenced_code", "codehilite"])
130
  messages_html += f"""
131
  <div style='display: flex; align-items: center; margin-bottom: 10px;'>
132
  <img src='{user_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>
 
135
 
136
  if assistant_message and assistant_message not in seen_messages:
137
  seen_messages.add(assistant_message)
138
+ assistant_message_html = markdown.markdown(escape_html(assistant_message), extensions=["fenced_code", "codehilite"])
139
  messages_html += f"""
140
  <div style='display: flex; align-items: center; margin-bottom: 10px;'>
141
  <img src='{assistant_pic}' style='width: 40px; height: 40px; border-radius: 50%; margin-right: 10px;'>