modify link format to allow for extensions after state

seems like the format sometimes has this
This commit is contained in:
Fraser
2023-08-08 23:05:08 -04:00
parent 4b855fb83c
commit 06a7209e2d
+4 -2
View File
@@ -69,8 +69,10 @@ def human(id):
# run a regex to replace all relative links with absolute links. Just doing
# a regex for now since we really don't need to parse everything out then
# re-serialize it for something this simple.
# <a href=\"/?state=6207\"> -> <a href=\"https://stampy.ai/?state=6207\">
text = re.sub(r'<a href=\\"/\?state=(\d+)\\">', r'<a href=\"https://aisafety.info/?state=\1\">', r.text)
# <a href=\"/?state=6207&question=What%20is%20%22superintelligence%22%3F\">
# ⬇️
# <a href=\"https://stampy.ai/?state=6207&question=What%20is%20%22superintelligence%22%3F\">
text = re.sub(r'<a href=\\"/\?state=(\d+.*)\\">', r'<a href=\"https://aisafety.info/?state=\1\\">', r.text)
return Response(text, mimetype='application/json')