Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -503,8 +503,8 @@ def render_citations(text: str, browser: SimpleBrowser) -> str:
|
|
| 503 |
pass
|
| 504 |
return m.group(0)
|
| 505 |
|
| 506 |
-
# First pass: replace citations with
|
| 507 |
-
result = re.sub(r'【(\d+)†.*?】', replace_citation, text)
|
| 508 |
|
| 509 |
# Second pass: Deduplicate adjacent identical citations
|
| 510 |
# Matches: <a ...>[N]</a> followed by optional whitespace and same link
|
|
|
|
| 503 |
pass
|
| 504 |
return m.group(0)
|
| 505 |
|
| 506 |
+
# First pass: replace citations with linked citations
|
| 507 |
+
result = re.sub(r'[【\[](\d+)†.*?[】\]]', replace_citation, text)
|
| 508 |
|
| 509 |
# Second pass: Deduplicate adjacent identical citations
|
| 510 |
# Matches: <a ...>[N]</a> followed by optional whitespace and same link
|