Closed jeffreylin82 closed 12 years ago
anyone else getting an autoescape error when the oembed html is rendered in a template?
I'm testing with a youtube URL.
When my database table stores the actual iframe embed code, the video is shown in the template correctly.
However, if the database stores just the youtube URL, oembed shows the iframe embed code with ascii codes for the angle brackets and quotation marks.
How do I fix this?
Using the safe filter doesn't help: {{ post.body|safe|oembed }}
Neither does using {% autoescape off %}
Might this be an error using beautifulsoup v.3 instead of beautifulsoup v.4?
Or might implementing mark_safe() help? https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#filters-and-auto-escaping
Yeah that's bs4. I've stopped dev on this project recommend you check out Micawber http://micawber.rtfd.org
thanks for the help!
anyone else getting an autoescape error when the oembed html is rendered in a template?
I'm testing with a youtube URL.
When my database table stores the actual iframe embed code, the video is shown in the template correctly.
However, if the database stores just the youtube URL, oembed shows the iframe embed code with ascii codes for the angle brackets and quotation marks.
How do I fix this?
Using the safe filter doesn't help: {{ post.body|safe|oembed }}
Neither does using {% autoescape off %}
Might this be an error using beautifulsoup v.3 instead of beautifulsoup v.4?
Or might implementing mark_safe() help? https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#filters-and-auto-escaping