当前位置: 首页>>代码示例>>PHP>>正文


PHP BuildMarkupRules函数代码示例

本文整理汇总了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;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:8,代码来源:diag.php

示例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);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:10,代码来源:diag.php

示例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;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:15,代码来源:diag.php

示例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;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:30,代码来源:pmwiki.php

示例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);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:43,代码来源:pmwiki.php


注:本文中的BuildMarkupRules函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。