Automatic link detection
This commit is contained in:
parent
8b9ce75959
commit
0b42dd7d52
2 changed files with 7 additions and 2 deletions
|
@ -31,7 +31,12 @@ class Event:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def description(self):
|
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
|
@property
|
||||||
def location(self):
|
def location(self):
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="description">
|
<div class="description">
|
||||||
{% if event.description %}
|
{% if event.description %}
|
||||||
{{ event.description }}
|
{{ event.description | safe }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="other">
|
<div class="other">
|
||||||
|
|
Reference in a new issue