'
+    for i, _row in enumerate(history[::-1]):
+        row = [convert_to_markdown(entry) for entry in _row]
+
+        output += f"""
+              
+            """
+
+        if len(row[0]) == 0:  # don't display empty user messages
+            continue
+
+        output += f"""
+              
+            """
+
+    output += "
'
+
+    # We use ?name2 and ?time.time() to force the browser to reset caches
+    img_bot = f'

' if Path("cache/pfp_character.png").exists() else ''
+    img_me = f'
 if reset_cache else )
' if Path("cache/pfp_me.png").exists() else ''
+
+    for i, _row in enumerate(history[::-1]):
+        row = [convert_to_markdown(entry) for entry in _row]
+
+        output += f"""
+              
+                
+                  {img_bot}
+                
+                
+                  
+                    {name2}
+                  
+                  
+                    {row[1]}
+                  
+                
+              
+            """
+
+        if len(row[0]) == 0:  # don't display empty user messages
+            continue
+
+        output += f"""
+              
+                
+                  {img_me}
+                
+                
+                  
+                    {name1}
+                  
+                  
+                    {row[0]}
+                  
+                
+              
+            """
+
+    output += "
'
+
+    for i, _row in enumerate(history[::-1]):
+        row = [convert_to_markdown(entry) for entry in _row]
+
+        output += f"""
+              
+            """
+
+        if len(row[0]) == 0:  # don't display empty user messages
+            continue
+
+        output += f"""
+              
+            """
+
+    output += "