XML object

30 views
Skip to first unread message

Jerry Liu

unread,
Mar 16, 2016, 3:12:04 PM3/16/16
to web2py-users

Hi, all

I want to use XML object to stop html from being escaped. But the object  seems not working on iframe tag.

I override it like this:

XML(text, sanitize=True,
    permitted_tags=['iframe', ...],
    allowed_attributes={'iframe':[...]})

Anthony

unread,
Mar 16, 2016, 3:21:25 PM3/16/16
to web2py-users
Are you inserting it in the view somehow:

{{=XML(...)}}

If so, what are you seeing in the final rendered HTML?

Anthony

Jerry Liu

unread,
Mar 16, 2016, 3:27:21 PM3/16/16
to web...@googlegroups.com
Yes, I am using it on html page.
It doesn't work when html contains iframe tag. 
iframe tag will still be escaped.
so I tried override, still not working.

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/-m2WWuOZ3Qw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Mar 16, 2016, 5:07:38 PM3/16/16
to web2py-users
Please show your exact view code as well as the final rendered HTML.
Reply all
Reply to author
Forward
0 new messages