1

我的 html 模板中有以下内容:

<pre>
<code class="language-markup">
    {% filter force_escape %}
    <Item>
        <MarkUp><a href="http://google.com">Google</a></MarkUp>
        <Normal>Hello</Normal>
    </Item>
    {% endfilter %}
</code>
</pre>

我希望它标记语言(我为此使用棱镜),但也标记“谷歌”项目的超链接。

以下是它的外观:

在此处输入图像描述

单击“Google”一词将打开该链接。

但这是它目前的样子:

在此处输入图像描述

此外,“Google”这个词是不可点击的——<code>标签中没有任何东西被链接。

我将如何用棱镜完成上述任务?

4

1 回答 1

0

Prism 似乎正好有一个插件。你可以在这里下载它:http: //prismjs.com/plugins/autolinker/。您可以使用这种格式:

[Text you want to see](http://url-goes-here.com)
于 2016-08-18T20:48:47.577 回答