linking is easy to use linkifier that converts URLs and emails to HTML hyperlinks
Code | https://github.com/w95/linking |
Issue tracker | https://github.com/w95/linking/issues |
License | MIT License; see LICENSE file |
linking is available on PyPI, so you can install it with pip
::
$ pip install linking
The simplest way to use linking is:
import linking
linking.text('some text tesla.com, ...')
# -> 'some text <a href="http://tesla.com">tesla.com</a>, ...'
linking.text('https://tesla.com', {'rel': 'nofollow'})
# -> '<a href="https://tesla.com" rel="nofollow">https://tesla.com</a>'
linking.text('[email protected]')
# -> '<a href="mailto:[email protected]">[email protected]</a>'