无法将第三方降价扩展集成到django-wiki markdown中

时间:2017-11-12 04:29:58

标签: python django markdown semantic-web django-wiki

我试图使用此扩展程序:https://github.com/aleray/mdx_semanticdata与django-wiki的降价但我无法让它工作(虽然它在python / django shell中运行很好) 。 (django-wiki: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_semanticdata和semanticdata作为扩展,请参见底部的settings.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的跨度包含内容和属性标记。我想在django-wiki中有内容和属性标签。有人可以帮忙吗?

我的settings.py:

WIKI_MARKDOWN_KWARGS = { 'extensions': [ 'semanticdata', 'footnotes', 'attr_list', 'headerid', 'extra', 'mdx_semanticdata', ], 'safe_mode': False, }

1 个答案:

答案 0 :(得分:1)

这与django-wiki如何消毒其输入有关。设置False到{{1}}解决了问题,但显然不建议这样做。