def expand_db_attributes(attrs, for_editor): """ Given a dict of attributes from the <embed> tag, return the real HTML representation. """ if for_editor: return format.embed_to_editor_html(attrs['url']) else: return format.embed_to_frontend_html(attrs['url'])
def expand_db_attributes(attrs, for_editor): """ Given a dict of attributes from the <embed> tag, return the real HTML representation. """ from wagtail.wagtailembeds import format if for_editor: return format.embed_to_editor_html(attrs["url"]) else: return format.embed_to_frontend_html(attrs["url"])
def expand_db_attributes(attrs, for_editor): """ Given a dict of attributes from the <embed> tag, return the real HTML representation. """ if for_editor: try: return format.embed_to_editor_html(attrs['url']) except embeds.EmbedException: # Could be replaced with a nice error message return '' else: return format.embed_to_frontend_html(attrs['url'])
def __str__(self): return embed_to_frontend_html(self.url)
def Embed(props): """ Inspired by: https://github.com/wagtail/wagtail/blob/master/wagtail/wagtailembeds/rich_text.py """ return DOM.parse_html(embed_to_frontend_html(props['url']))
def render_basic(self, value): return embed_to_frontend_html(value)
def render(self, props): return DOM.parse_html(embed_to_frontend_html(props['url']))