I would like to use some HTML messages in the turbogears abort function.
Although the name does not match exactly (I use the 'tg.abort' function), this is the abort definition I found : abort
The code used currently :
from tg import abort
message="The following {} occured, this is due to {}, please visit this url : {}".format(error, reason, url)
abort(status_code=502, detail=message)
I would like to have something like this :
from tg import abort
message="""The following error occured : {}</br>
The most probable reason would be {} </br>
<a href="{}">Your solution might be found here</a>
""".format(error, reason, url)
abort(status_code=502, detail=message)
I think the content is automatically escaped.
The Html page generated from the abort function, endering something like this :
<html>
<head>
<title>502 Bad Gateway</title>
</head>
<body>
<h1>502 Bad Gateway</h1>
Bad gateway.<br /><br />
The following error occured : hungry<br/>
The most probable reason would be : maybe you should eat </br>
<a href="http://dummyurl">Your solution might be found here</a>
</body>
</html>
If you have any idea of how to insert html code without escaping, I would be very interested. Also I really am focused on the abort method here, I am aware that I could use some dedicated page that would use a templating framework (like the rest of the website).
Thank you very much.
Regards