页面文本:禁止将 HTML 个链接转换为 HTML 个实体
Page text: disable conversion of HTML links to HTML entities
我有一个旧的 Mediawiki 站点 (1.6.x),我需要将它升级到 1.31。该站点有许多页面,其中许多页面的文本带有 HTML 格式的 html 链接,例如:
<a href="/index.php?title=My_PAGE">Text</a>
我可以将其数据库升级到 1.31。但是,在显示中,上面的 html 链接被转换为
<a href="/index.php?title=My_PAGE">TEXT</a>
如何防止 Mediawiki (1.31.x) 执行上述转换?
我目前不确定如何防止 MediaWiki 更改您的代码,但一个可能的解决方案是使用这个
https://www.mediawiki.org/wiki/Extension:Replace_Text
升级后将 <
替换为 <
和 >
与 >
找不到方法,我干脆在ExampleTemplate.php
的public function execute()
里加了下面两行
$html = str_replace('<', '<', $html);
$html = str_replace('>', '>', $html);
如果你有更好的方法,请告诉我。
我有一个旧的 Mediawiki 站点 (1.6.x),我需要将它升级到 1.31。该站点有许多页面,其中许多页面的文本带有 HTML 格式的 html 链接,例如:
<a href="/index.php?title=My_PAGE">Text</a>
我可以将其数据库升级到 1.31。但是,在显示中,上面的 html 链接被转换为
<a href="/index.php?title=My_PAGE">TEXT</a>
如何防止 Mediawiki (1.31.x) 执行上述转换?
我目前不确定如何防止 MediaWiki 更改您的代码,但一个可能的解决方案是使用这个
https://www.mediawiki.org/wiki/Extension:Replace_Text
升级后将 <
替换为 <
和 >
与 >
找不到方法,我干脆在ExampleTemplate.php
的public function execute()
里加了下面两行
$html = str_replace('<', '<', $html);
$html = str_replace('>', '>', $html);
如果你有更好的方法,请告诉我。