本文整理匯總了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;
}