我正在尝试将这个扩展:https://github.com/aleray/mdx_semanticdata与django wiki的markdown一起使用,但是我无法让它工作(尽管它在python/django shell中工作得很好)。(django维基:https://github.com/django-wiki/django-wiki/)
添加此行
%%dc:author :: Sherry Turkle | Turkle's%% %%dc:title::Second Self%% was an early book on the social aspects of computation.
django wiki文章(以mdx\u Semanticata和Semanticata作为扩展名,请参阅设置.py在底部)给我
<p><span>Turkle's</span> <span>Second Self</span> was an early book on the social aspects of computation."</p>
鉴于
import markdown
text = "%%dc:author :: Sherry Turkle | Turkle's%% %%dc:title::Second Self%% was an early book on the social aspects of computation."
html = markdown.markdown(text, ['semanticdata'])
print(html)
在python shell中:
<p><span content="Sherry Turkle" property="dc:author">Turkle's</span> <span content="Second Self" property="dc:title">Second Self</span> was an early book on the social aspects of computation.</p>
请注意python shell中的span具有content和property标记。我想在DjangoWiki的内容和属性标签。有人能帮忙吗?你知道吗
我的设置.py地址:
WIKI_MARKDOWN_KWARGS = {
'extensions': [
'semanticdata',
'footnotes',
'attr_list',
'headerid',
'extra',
'mdx_semanticdata',
],
'safe_mode': False,
}
这与django wiki如何清理其输入有关。设置
WIKI_MARKDOWN_SANITIZE_HTML
到False
解决了问题,但显然不建议这样做。你知道吗相关问题 更多 >
编程相关推荐