You are here

public function TokenParser::parse in Markdown 3.0.x

File

src/Twig/Markdown/TokenParser.php, line 30

Class

TokenParser
Class MarkdownTokenParser.

Namespace

Drupal\markdown\Twig\Markdown

Code

public function parse(Token $token) {
  $line = $token
    ->getLine();
  $this->parser
    ->getStream()
    ->expect(\Twig_Token::BLOCK_END_TYPE);
  $body = $this->parser
    ->subparse(function (\Twig_Token $token) {
    return $token
      ->test('endmarkdown');
  }, TRUE);
  $this->parser
    ->getStream()
    ->expect(\Twig_Token::BLOCK_END_TYPE);
  return new Node($body, $line, $this
    ->getTag());
}