Login

Tag "html parser"

Snippet List

urlize HTML

The default Django urlize filter does not work with html nicely so here I've used an HTML parser [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/) to quickly search through each text node and run the django urlize filter on it. Optimizations could be made to include a regex in the soup.findAll() method's text argument to only search those text nodes which matched a url pattern. You could also modify the method to convert the text to urls, such as using your own custom url filter.

  • beautifulsoup
  • html
  • urlize
  • parser
  • html parser
Read More

1 snippet posted so far.