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


PHP MWTidy::getModuleStyles方法代码示例

本文整理汇总了PHP中MWTidy::getModuleStyles方法的典型用法代码示例。如果您正苦于以下问题:PHP MWTidy::getModuleStyles方法的具体用法?PHP MWTidy::getModuleStyles怎么用?PHP MWTidy::getModuleStyles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MWTidy的用法示例。


在下文中一共展示了MWTidy::getModuleStyles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: internalParseHalfParsed

 /**
  * Helper function for parse() that transforms half-parsed HTML into fully
  * parsed HTML.
  *
  * @param string $text
  * @param bool $isMain
  * @param bool $linestart
  * @return string
  */
 private function internalParseHalfParsed($text, $isMain = true, $linestart = true)
 {
     $text = $this->mStripState->unstripGeneral($text);
     if ($isMain) {
         Hooks::run('ParserAfterUnstrip', array(&$this, &$text));
     }
     # Clean up special characters, only run once, next-to-last before doBlockLevels
     $fixtags = array('/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1 ', '/(\\302\\253) /' => '\\1 ', '/ (!\\s*important)/' => ' \\1');
     $text = preg_replace(array_keys($fixtags), array_values($fixtags), $text);
     $text = $this->doBlockLevels($text, $linestart);
     $this->replaceLinkHolders($text);
     /**
      * The input doesn't get language converted if
      * a) It's disabled
      * b) Content isn't converted
      * c) It's a conversion table
      * d) it is an interface message (which is in the user language)
      */
     if (!($this->mOptions->getDisableContentConversion() || isset($this->mDoubleUnderscores['nocontentconvert']))) {
         if (!$this->mOptions->getInterfaceMessage()) {
             # The position of the convert() call should not be changed. it
             # assumes that the links are all replaced and the only thing left
             # is the <nowiki> mark.
             $text = $this->getConverterLanguage()->convert($text);
         }
     }
     $text = $this->mStripState->unstripNoWiki($text);
     if ($isMain) {
         Hooks::run('ParserBeforeTidy', array(&$this, &$text));
     }
     $text = $this->replaceTransparentTags($text);
     $text = $this->mStripState->unstripGeneral($text);
     $text = Sanitizer::normalizeCharReferences($text);
     if (MWTidy::isEnabled() && $this->mOptions->getTidy()) {
         $text = MWTidy::tidy($text);
         $this->mOutput->addModuleStyles(MWTidy::getModuleStyles());
     } else {
         # attempt to sanitize at least some nesting problems
         # (bug #2702 and quite a few others)
         $tidyregs = array('/(<([bi])>)(<([bi])>)?([^<]*)(<\\/?a[^<]*>)([^<]*)(<\\/\\4>)?(<\\/\\2>)/' => '\\1\\3\\5\\8\\9\\6\\1\\3\\7\\8\\9', '/(<a[^>]+>)([^<]*)(<a[^>]+>[^<]*)<\\/a>(.*)<\\/a>/' => '\\1\\2</a>\\3</a>\\1\\4</a>', '/(<([aib]) [^>]+>)([^<]*)(<div([^>]*)>)(.*)(<\\/div>)([^<]*)(<\\/\\2>)/' => '\\1\\3&lt;div\\5&gt;\\6&lt;/div&gt;\\8\\9', '/<([bi])><\\/\\1>/' => '');
         $text = preg_replace(array_keys($tidyregs), array_values($tidyregs), $text);
     }
     if ($isMain) {
         Hooks::run('ParserAfterTidy', array(&$this, &$text));
     }
     return $text;
 }
开发者ID:OrBin,项目名称:mediawiki,代码行数:56,代码来源:Parser.php


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