djangosnippets.org: Latest snippets tagged with 'html parser'https://djangosnippets.org/tags/html-parser/2010-06-18T18:51:01.277575-05:00urlize HTML
2010-06-18T18:51:01.277575-05:00maguspkhttps://djangosnippets.org/snippets/2072/<p>The default Django urlize filter does not work with html nicely so here I've used an HTML parser <a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> to quickly search through each text node and run the django urlize filter on it. </p>
<p>Optimizations could be made to include a regex in the soup.findAll() method's text argument to only …</p>
Freely redistributable