让我现在摆出场景。我刚刚开始设置PMWiki安装。到目前为止,这么好,对吧?如何更正弃用的功能?
因此,我添加pagetoc.php
如PMWiki Cookbook for Pagetoc中所述。接下来,我想添加Markdown
支持。所以谷歌搜索带我到Cookbook for Markdown。它还表示MarkdownMarkupExtension Cookbook作为检查的东西。两者都已安装。我不确定它们是否与两者冲突,但似乎没有什么可以抛出......除了下面的错误。
Pagetoc.php
工作得很好。什么不是markdown.php
。在此产生的错误如下:
ERROR: pat=/\(:markdown:\)(.*?)[ ]?\(:markdownend:\)/se preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
现在......这里是在markdown.php
相关代码。
显然,修正是使用preg_replace_callback()
函数。我正在看这个,它看起来像一大堆面条。我不确定为了解决这个问题向前迈出了什么正确的一步。我对PHP不熟悉,无法按照建议使用该功能。
<?php if (!defined('PmWiki')) exit();
#
# Markdown -
#
# Copyright (c) 2006 Benjamin C. Wilson
# <http://www.dausha.net/Markdown/Recipe>
#
#$EnableMarkdownInline = 0;
include_once("$FarmC/pagetoc.php");
include_once("$FarmD/scripts/diag.php");
SDV($EnableMarkdown,0); # Off by default.
SDV($MarkdownSectionLevel, '!!'); # Creates <h2> for === sections.
SDV($MarkdownSubSectionLevel, '!!!'); # Creates <h3> for --- sections.
SDV($MarkdownSubSubSectionLevel, '!!!!'); # Creates <h4> for --- sections.
if ($EnableMarkdown) {
$EnableStdMarkup = 0; # Turn off PmWiki's markup behavior.
SDV($MarkdownTabWidth, 4);
SDV($MarkdownTabLessOne, $MarkdownTabWidth - 1);
SDV($EnableMarkdownInline, 1);
SDV($EnableMarkdownLinks, 1);
SDV($EnableMarkdownBlock, 1);
SDV($EnableMarkdownPrecode, 1);
SDV($EnableMarkdownLists, 1);
SDV($EnableMarkdownBlockquotes, 1);
include_once("markdown/pmwiki-directives.php");
include_once("markdown/pmwiki-links.php");
include_once("markdown/pmwiki-advtables.php");
include_once("markdown/pmwiki-block.php");
include_once("markdown/pmwiki-inline.php"); # Added 2006-05-07 BCWI
$HTMLVSpace = '';
}
if ($EnableMarkdownInline) include_once("markdown/markdown-inline.php");
if ($EnableMarkdownLinks) include_once("markdown/markdown-links.php");
if ($EnableMarkdownBlock) include_once("markdown/markdown-block.php");
if ($EnableMarkdownPrecode) include_once("markdown/markdown-precode.php");
if ($EnableMarkdownLists) include_once("markdown/markdown-lists-0.2.php");
if ($EnableMarkdownBlockquotes) include_once("markdown/markdown-blockquotes.php");
/*
#Markup("prebullet", "<bullet", "/^(\s+)\\*\s/e", "deindent('$1','*');");
#Markup("preordered", "<orderedlists", "/^(\s+)(\\#|[0-9]+\.)\s/e", "deindent('$1','#');");
function deindent($stuff,$type) {
$level = (int) strlen($stuff)/3;
return str_pad('',$level,$type);
}
## bullet lists
Markup('bullets','block','/^(\\*+)\\s?(\\s*)/','<:ul,$1,$0>$2');
Markup('orderedlists','<bullets','/^(#+)\\s?(\\s*)/','<:ol,$1,$0>$2');
*/
'Markup_e'已被弃用一段时间了。这是不正确的。 – wizzwizz4