/** * The pattern for autogen comments is / * foo * /, which makes for * some nasty regex. * We look for all comments, match any text before and after the comment, * add a separator where needed and format the comment itself with CSS * Called by Linker::formatComment. * * @param $comment String: comment text * @param $title An optional title object used to links to sections * @param $local Boolean: whether section links should refer to local page * @return String: formatted comment */ private static function formatAutocomments($comment, $title = null, $local = false) { // Bah! self::$autocommentTitle = $title; self::$autocommentLocal = $local; $comment = preg_replace_callback('!(.*)/\\*\\s*(.*?)\\s*\\*/(.*)!', array('Linker', 'formatAutocommentsCallback'), $comment); self::$autocommentTitle = null; self::$autocommentLocal = null; return $comment; }