Beispiel #1
0
def enhance_tables(content):
    if not isinstance(content, contents.Article):
        return

    with modify_html(content) as html_tree:
        for table in html_tree.findall('.//table'):
            div = etree.Element('div')
            div.set('class', 'table')
            wrap_element(table, div)
Beispiel #2
0
def tweet_to_figure(blockquote):
    if 'twitter-tweet' not in blockquote.classes:
        return

    wrap_element(blockquote, etree.Element('figure'))
Beispiel #3
0
def object_to_figure(object_):
    wrap_element(object_, etree.Element('figure'))
Beispiel #4
0
def iframe_to_figure(iframe):
    wrap_element(iframe, etree.Element('figure'))