[web2py] What's the best way to insert raw html ?

2010-12-29 Thread Stef Mientki
hello, I'v raw html derived with BeautifulSoup from another webpage, which I want insert in the contents of the web. The images in the orginal webpage are located in the same directory as the html page. The orginal webpage is moved to a database, and the images are placed into the web2py

Re: [web2py] What's the best way to insert raw html ?

2010-12-29 Thread Jonathan Lundell
On Dec 29, 2010, at 3:10 PM, Stef Mientki wrote: Now I encounter 2 problems: 1. the raw html contains tags, like: ptoch iets over stromen, een plaatje/ppbr //pbr /pnbsp;nbsp; I remove them with the helper function TAG. Although it seems to work, I'm not convinced that this is

Re: [web2py] What's the best way to insert raw html ?

2010-12-29 Thread Stef Mientki
An alternative to Text.replace would be to do a global regex substitution, where the replacement pattern is a function that calls URL('static', 'images/%s' % matchobj.group(0)). See the re.sub section of http://docs.python.org/library/re.html for details. regex are too difficult for me