I have a function to automatically replace issue IDs to links:
def addlinks(text):
from flask import Markup
idlist = getallissueids()
for issueid in idlist:
text = text.replace( issueid, "<a href=/browse/" + issueid +">" + issueid + "</a>")
return Markup(text)
Then {{text}} is passed to template.
It works, but there is a side effect - all kind of html is unescaped in text after this. Is there any way to avoid html escaping only for the link?