diff --git a/modules/doc/library/Doc/DocParser.php b/modules/doc/library/Doc/DocParser.php index 40a6c298e..728dd1c08 100644 --- a/modules/doc/library/Doc/DocParser.php +++ b/modules/doc/library/Doc/DocParser.php @@ -160,12 +160,11 @@ class DocParser $cat = array_merge($cat, $chapter); } } - $html = preg_replace_callback( + return preg_replace_callback( '#
(.*?)\
#s',
array($this, 'highlight'),
Parsedown::instance()->text(implode('', $cat))
);
- return $html;
}
/**
@@ -194,9 +193,9 @@ class DocParser
return null;
}
$header = null;
- if ($line &&
- $line[0] === '#' &&
- preg_match('/^#+/', $line, $match) === 1
+ if ($line
+ && $line[0] === '#'
+ && preg_match('/^#+/', $line, $match) === 1
) {
// Atx-style
$level = strlen($match[0]);
@@ -205,9 +204,9 @@ class DocParser
return null;
}
} elseif (
- $line &&
- ($line[0] === '=' || $line[0] === '-') &&
- preg_match('/^[=-]+\s*$/', $line, $match) === 1
+ $line
+ && ($line[0] === '=' || $line[0] === '-')
+ && preg_match('/^[=-]+\s*$/', $line, $match) === 1
) {
// Setext
$header = trim($lastLine);
@@ -235,8 +234,8 @@ class DocParser
*/
protected function extractHeaderId(&$header)
{
- if ($header[0] === '<' &&
- preg_match('#(?:<(?P