示例#1
0
 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'])
示例#2
0
    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"])
示例#3
0
 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'])
示例#4
0
文件: blocks.py 项目: iicc/wagtail
 def __str__(self):
     return embed_to_frontend_html(self.url)
示例#5
0
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']))
示例#6
0
 def render_basic(self, value):
     return embed_to_frontend_html(value)
示例#7
0
 def render(self, props):
     return DOM.parse_html(embed_to_frontend_html(props['url']))