本文整理匯總了PHP中BuildMarkupRules函數的典型用法代碼示例。如果您正苦於以下問題:PHP BuildMarkupRules函數的具體用法?PHP BuildMarkupRules怎麽用?PHP BuildMarkupRules使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BuildMarkupRules函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Ruleset
function Ruleset() {
global $MarkupTable;
$out = '';
BuildMarkupRules();
foreach($MarkupTable as $id=>$m)
$out .= sprintf("%-16s %-16s %-16s\n",$id,@$m['cmd'],@$m['seq']);
return $out;
}
示例2: Ruleset
function Ruleset()
{
global $MarkupTable;
$out = array();
BuildMarkupRules();
foreach ($MarkupTable as $id => $m) {
$out[] = sprintf("%-16s %-16s %-16s", $id, @$m['cmd'], @$m['seq']);
}
return implode("\n", $out);
}
示例3: Ruleset
function Ruleset() {
global $MarkupTable;
$out = '';
$dbg = 0;
BuildMarkupRules();
foreach($MarkupTable as $id=>$m) {
$out .= sprintf("%-16s %-16s %-16s %s\n",$id,@$m['cmd'],@$m['seq'], @$m['dbg']);
if(@$m['dbg']) $dbg++;
}
if($dbg) $out .= "
[!] Markup rules possibly incompatible with PHP 5.5 or newer.
Please contact the recipe maintainer for update
or see www.pmwiki.org/wiki/PmWiki/CustomMarkup";
return $out;
}
示例4: MarkupToHTML
function MarkupToHTML($pagename, $text, $opt = NULL) {
# convert wiki markup text to HTML output
global $MarkupRules, $MarkupFrame, $MarkupFrameBase, $WikiWordCount,
$K0, $K1, $RedoMarkupLine;
StopWatch('MarkupToHTML begin');
array_unshift($MarkupFrame, array_merge($MarkupFrameBase, (array)$opt));
$MarkupFrame[0]['wwcount'] = $WikiWordCount;
$markrules = BuildMarkupRules();
foreach((array)$text as $l)
$lines[] = $MarkupFrame[0]['escape']
? PVS(htmlspecialchars($l, ENT_NOQUOTES)) : $l;
$lines[] = '(:closeall:)';
$out = '';
while (count($lines)>0) {
$x = array_shift($lines);
$RedoMarkupLine=0;
foreach($markrules as $p=>$r) {
if ($p{0} == '/') $x=preg_replace($p,$r,$x);
elseif (strstr($x,$p)!==false) $x=eval($r);
if (isset($php_errormsg)) { echo "pat=$p"; unset($php_errormsg); }
if ($RedoMarkupLine) { $lines=array_merge((array)$x,$lines); continue 2; }
}
if ($x>'') $out .= "$x\n";
}
foreach((array)(@$MarkupFrame[0]['posteval']) as $v) eval($v);
array_shift($MarkupFrame);
StopWatch('MarkupToHTML end');
return $out;
}
示例5: MarkupToHTML
function MarkupToHTML($pagename, $text)
{
# convert wiki markup text to HTML output
global $MarkupRules, $MarkupFrame, $MarkupFrameBase, $K0, $K1, $RedoMarkupLine;
StopWatch('MarkupToHTML begin');
array_unshift($MarkupFrame, $MarkupFrameBase);
$markrules = BuildMarkupRules();
foreach ((array) $text as $l) {
$lines[] = htmlspecialchars($l, ENT_NOQUOTES);
}
$out = array();
while (count($lines) > 0) {
$x = array_shift($lines);
$RedoMarkupLine = 0;
foreach ($markrules as $p => $r) {
if (substr($p, 0, 1) == '/') {
$x = preg_replace($p, $r, $x);
} elseif ($p == '' || strstr($x, $p) !== false) {
$x = eval($r);
}
if (isset($php_errormsg)) {
echo "pat={$p}";
unset($php_errormsg);
}
if ($RedoMarkupLine) {
$lines = array_merge((array) $x, $lines);
continue 2;
}
}
if ($x > '') {
$out[] = "{$x}\n";
}
}
foreach ((array) $MarkupFrame[0]['posteval'] as $v) {
$x = eval($v);
if ($x > '') {
$out[] = "{$x}\n";
}
}
array_shift($MarkupFrame);
StopWatch('MarkupToHTML end');
return implode('', (array) $out);
}