option['is_html'] && ! $this->option['parse_wiki']) {
return $data;
}
// remove tiki comments first
if ($this->option['ck_editor']) {
$data = preg_replace(';~tc~(.*?)~/tc~;s', '$1", $data);
// Handle comments again in case parse_first method above returned wikiplugins with comments (e.g. PluginInclude a wiki page with comments)
$data = preg_replace(';~tc~(.*?)~/tc~;s', '', $data);
// Handle html comment sections
$data = preg_replace(';~hc~(.*?)~/hc~;s', '', $data);
// Replace special characters
// done after url catching because otherwise urls of dyn. sites will be modified // What? Chealer
// must be done before color as we can have "~hs~~hs" (2 consecutive non-breaking spaces. The color syntax uses "~~".)
// jb 9.0 html entity fix - excluded not $this->option['is_html'] pages
if (! $this->option['is_html']) {
$this->parse_htmlchar($data);
}
//needs to be before text color syntax because of use of htmlentities in lib/core/WikiParser/OutputLink.php
$data = $this->parse_data_wikilinks($data, false, $this->option['ck_editor']);
// Replace colors ~~foreground[,background]:text~~
// must be done before []as the description may contain color change
$parse_color = 1;
$temp = $data;
while ($parse_color) { // handle nested colors, parse innermost first
$temp = preg_replace_callback(
"/~~([^~:,]+)(,([^~:]+))?:([^~]*)(?!~~[^~:,]+(?:,[^~:]+)?:[^~]*~~)~~/Ums",
'ParserLib::colorAttrEscape',
$temp,
-1,
$parse_color
);
if (! empty($temp)) {
$data = $temp;
}
}
// On large pages, the above preg rule can hit a BACKTRACE LIMIT
// In case it does, use the simpler color replacement pattern.
if (empty($temp)) {
$data = preg_replace_callback(
"/\~\~([^\:\,]+)(,([^\:]+))?:([^~]*)\~\~/Ums",
'ParserLib::colorAttrEscape',
$data
);
}
// Extract [link] sections (to be re-inserted later)
$noparsedlinks = [];
// This section matches [...].
// Added handling for [[foo] sections. -rlpowell
preg_match_all("/(?", $data);
$data = preg_replace("/\{r2l\}/", "