首页 > django如何渲染markdown的表格?

django如何渲染markdown的表格?

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


默认不支持, 需要配置 扩展项

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
【热门文章】
【热门文章】