worldcompany / djangoembed

rich media consuming and providing with django
http://djangoembed.readthedocs.org
MIT License
138 stars 38 forks source link

safe (autoescape) errors in template #39

Closed jeffreylin82 closed 12 years ago

jeffreylin82 commented 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

coleifer commented 12 years ago

Yeah that's bs4. I've stopped dev on this project recommend you check out Micawber http://micawber.rtfd.org

jeffreylin82 commented 12 years ago

thanks for the help!