About Clickable Links in Text

When working with data coming from unpredicted external sources, bleach.linkify() seems to be more stable than django.utils.html.urlize().

1
2
3
4
5
6
7
html = "[aaa]http://ok.com"

urlize(html)
'[<a href="http://aaa]http://ok.com">aaa]http://ok.com</a>'

linkify(html)
'[aaa]<a href="http://ok.com" rel="nofollow">http://ok.com</a>'

Tips and Tricks Programming Django 4.2 Django 3.2 Django 2.2 Python 3