def demo4(): text = """ <html> <table> <tr><td>http://google.ca</td></tr> <tr><td>http://reddit.com</td></tr> </table> </html> """ doc = lx.to_doc(text) doc = lx.autolink(doc) print lx.prettify(doc)
def test_autolink(): doc = lx.to_doc(ex.TEXT) doc = lx.autolink(doc) html = lx.tostring(doc) assert '<a href="http://retrogames.com/games/commando">http://retrogames.com/games/commando</a>' in html