Carlos Rosas commited on
Commit
e96cc49
·
verified ·
1 Parent(s): 3a275e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -122,7 +122,7 @@ class pleiasBot:
122
  return None, None, None
123
 
124
  def format_references(text):
125
- ref_pattern = r'<ref name="([^"]+)">"([^"]+)"</ref>'
126
 
127
  parts = []
128
  current_pos = 0
@@ -137,7 +137,7 @@ def format_references(text):
137
  ref_id = match.group(1)
138
  ref_text = match.group(2).strip()
139
 
140
- # Add the reference, keeping the existing period before the line break
141
  tooltip_html = f'<span class="tooltip"><strong>[{ref_number}]</strong><span class="tooltiptext"><strong>{ref_id}</strong>: {ref_text}</span></span>.<br>'
142
  parts.append(tooltip_html)
143
 
@@ -226,7 +226,7 @@ with demo:
226
  # Header with black bar
227
  gr.HTML("""
228
  <div style="display: flex; justify-content: center; width: 100%; background-color: black; padding: 5px 0;">
229
- <pre style="font-family: monospace; line-height: 1.2; font-size: 12px; color: #00ffea; margin: 0;">
230
 
231
  _ _ ______ ___ _____
232
  | | (_) | ___ \/ _ \| __ \
 
122
  return None, None, None
123
 
124
  def format_references(text):
125
+ ref_pattern = r'<ref name="([^"]+)">"([^"]+)"</ref>\.\s*' # Modified pattern to include the period and whitespace after ref
126
 
127
  parts = []
128
  current_pos = 0
 
137
  ref_id = match.group(1)
138
  ref_text = match.group(2).strip()
139
 
140
+ # Add the reference, keeping the existing structure but adding <br> where whitespace was
141
  tooltip_html = f'<span class="tooltip"><strong>[{ref_number}]</strong><span class="tooltiptext"><strong>{ref_id}</strong>: {ref_text}</span></span>.<br>'
142
  parts.append(tooltip_html)
143
 
 
226
  # Header with black bar
227
  gr.HTML("""
228
  <div style="display: flex; justify-content: center; width: 100%; background-color: black; padding: 5px 0;">
229
+ <pre style="font-family: monospace; line-height: 1.2; font-size: 8px; color: #00ffea; margin: 0;">
230
 
231
  _ _ ______ ___ _____
232
  | | (_) | ___ \/ _ \| __ \