Automatic link detection

This commit is contained in:
Edgar P. Burkhart 2022-01-27 18:07:21 +01:00
parent 8b9ce75959
commit 0b42dd7d52
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
2 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,12 @@ class Event:
@property
def description(self):
return self._description
if self._description is None: return None
return re.sub(
r'(https?://\S+)',
r'<a href="\1">\1</a>',
self._description,
)
@property
def location(self):

View File

@ -50,7 +50,7 @@
<div class="info">
<div class="description">
{% if event.description %}
{{ event.description }}
{{ event.description | safe }}
{% endif %}
</div>
<div class="other">