allowedModes = []; } /** @inheritdoc */ public function getSort() { return 5; } /** @inheritdoc */ public function connectTo($mode) { global $conf; // PHP `\\\\\\\\` → regex `\\\\` → matches two literal backslashes. $lookahead = $conf['syntax'] === 'md' ? '' : '(?!\\\\\\\\[ \t\n])'; $this->Lexer->addSpecialPattern( $lookahead . '\\\\' . Escape::PUNCTUATION_CHAR_CLASS, $mode, 'gfm_escape' ); } /** @inheritdoc */ public function handle($match, $state, $pos, Handler $handler) { $handler->addCall('cdata', [substr($match, 1)], $pos); return true; } }