public function convert($markdown)
    {
        $root = new Container();

        $this->inlineParser = new InlineParser($this->links, $this->titles);
        $parser = $this->buildParserStack();

        $text = new Text($markdown);
        $this->prepare($text);

        $parser->parseBlock($text, $root);

        $this->inlineParser->parse();

        return $root;
    }