本文整理汇总了PHP中LanguageConverter::markNoConversion方法的典型用法代码示例。如果您正苦于以下问题:PHP LanguageConverter::markNoConversion方法的具体用法?PHP LanguageConverter::markNoConversion怎么用?PHP LanguageConverter::markNoConversion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LanguageConverter
的用法示例。
在下文中一共展示了LanguageConverter::markNoConversion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: markNoConversion
function markNoConversion($text, $noParse = false)
{
if ($noParse || preg_match("/^https?:\\/\\/|ftp:\\/\\/|irc:\\/\\//", $text)) {
return parent::markNoConversion($text);
}
return $text;
}
示例2: markNoConversion
/**
* Prepare external link text for conversion. When the text is
* a URL, it shouldn't be converted, and it'll be wrapped in
* the "raw" tag (-{R| }-) to prevent conversion.
*
* This function is called "markNoConversion" for historical
* reasons.
*
* @param $text String: text to be used for external link
* @param $noParse bool: wrap it without confirming it's a real URL first
* @return string the tagged text
*/
public function markNoConversion( $text, $noParse = false ) {
// Excluding protocal-relative URLs may avoid many false positives.
if ( $noParse || preg_match( '/^(?:' . wfUrlProtocolsWithoutProtRel() . ')/', $text ) ) {
return $this->mConverter->markNoConversion( $text );
} else {
return $text;
}
}
示例3: markNoConversion
/**
* Enclose a string with the "no conversion" tag. This is used by
* various functions in the Parser
*
* @param $text String: text to be tagged for no conversion
* @param $noParse bool
* @return string the tagged text
*/
public function markNoConversion($text, $noParse = false)
{
return $this->mConverter->markNoConversion($text, $noParse);
}
示例4: markNoConversion
function markNoConversion($text)
{
if (preg_match("/^https?:\\/\\/|ftp:\\/\\/|irc:\\/\\//", $text)) {
return parent::markNoConversion($text);
}
return $text;
}