无法将第三方标记扩展集成到Djangowiki标记中

2024-10-01 13:33:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试将这个扩展: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, }


Tags: thedjangoanonwikisocialdcmarkdown