hello one and all,
TAG() helper is interesting. i'm running web2py version 2.14.6. here is a
controller function:
def viewTest():
raw = '<html><head><title>ok man</title></head><body><p>this is a test
<input type="text"></input><br />of the American Broadcast System. <input
type="text"></input><br />this is only a test. <input
type="text"></input></p></body></html>'
rawHead = raw[raw.find('<head>')+6:raw.rfind('</head>')]
rawBody = raw[raw.find('<body>')+6:raw.rfind('</body>')]
div = TAG(rawBody)
ss = div.elements('input')
return HTML(HEAD(TAG(rawHead)), BODY(CAT(P("rawHead: ", rawHead, BR(),
"rawBody: ", rawBody), div, P("%i" % len(ss), "%s" % type(div)))))
the most interesting part, and i think it is a bug in TAG of web2py, is
that it doubles the <br /> with <br></br><br></br>. and if you only make
it <br>, without the slash, it will return the proper single <br></br> but
then return two more <br></br> at the very end before the </p>, which
totally throws off spacing if that is important. AND finally, if you have
<br></br>, instead of <br />, it doubles each by replacing it with
<br></br><br></br>.
so no option i can think of is working properly. try it, you'll like it,
just like mikey. lucas
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.