/** * @param Token $token * @return string */ protected function listTag(Token $token) { $tag = ''; if ($token->match('BULLET')) { $tag = 'ul'; } elseif ($token->match('NUM_DOT') || $token->match('NUM_PAR')) { $tag = 'ol'; } return $tag; }
/** * @param object $parent * @param Token $token * @param mixed $context * @return boolean */ protected function routeInline($parent, $token, $context = null) { $match = true; if ($token->match('IMG_OPEN')) { $this->putBack($token)->parseImage($parent); } elseif ($token->match('PAR_OPEN') == '[') { $this->putBack($token)->parseLink($parent); } elseif ($token->match('AST_OPEN')) { $this->putBack($token)->parseEmAsterisk($parent); } elseif ($token->match('UND_OPEN')) { $this->putBack($token)->parseEmUnderscore($parent); } elseif ($token->match('CODE')) { $this->putBack($token)->parseInlineCode($parent); } elseif ($token->match('TAG_OPEN')) { $this->putBack($token)->parseInlineHtml($parent); } elseif ($token->match('COM_OPEN')) { $this->putBack($token)->parseComment($parent); } elseif ($token->match('MU_TAG')) { $this->putBack($token)->parseMustache($parent); } else { $match = false; } return $match; }
/** * @param Token $token */ protected function transOptDefault(Token $token) { if ($token->match('ATT_SYMBOL') == '}') { $this->switchContext('markdown'); } elseif ($token->match('ATT_QUOTE1')) { $this->switchContext('opt-quoted1'); } elseif ($token->match('ATT_QUOTE2')) { $this->switchContext('opt-quoted2'); } }
/** * @param Token $token * @return boolean */ protected function breaksInline(Token $token) { $break = false; if ($token->match('SECTION')) { $this->putBack($token); $break = true; } elseif ($token->match('VSPACE')) { $break = true; } return $break; }