python - django如何渲染markdown的表格?
巴扎黑
巴扎黑 2017-04-17 17:24:21
0
1
786

我用的Django1.8, 插件时Markdown,但是不能渲染表格,有什么好的解决办法吗?

巴扎黑
巴扎黑

reply all(1)
左手右手慢动作

Not supported by default, need to configure extensions

def md(str_md=''):
    '''
    Renders the specified markdown content and embedded styles.
    '''
    str_html = ''
    str_html = markdown(str_md, extensions=[
        # 'urlize',
        'fenced_code',
        'codehilite(css_class=highlight)',
        'toc',
        'tables',
        'sane_lists',
    ])
    return str_htmldef gfm(str_md=''):
    '''
    Renders the specified markdown content and embedded styles.
    '''
    str_html = ''
    str_html = markdown(str_md, extensions=[
        # 'urlize',
        'fenced_code',
        'codehilite(css_class=highlight)',
        'toc',
        'tables',
        'sane_lists',
    ])
    return str_html
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template