public function compile(\Twig_Compiler $compiler)
    {
        $compiler->addDebugInfo($this);

        $compiler
            ->write('$highlighter = \Ramsey\Twig\CodeBlock\Highlighter\HighlighterFactory::getHighlighter(')
            ->string($this->getHighlighterName())
            ->raw(', ')
            ->repr($this->getHighlighterArgs())
            ->raw(");\n");

        $compiler
            ->write('$highlightedCode = $highlighter->highlight(')
            ->string($this->getNode('body')->getAttribute('data'))
            ->raw(', ')
            ->repr($this->attributes)
            ->raw(");\n");

        if ($this->hasAttribute('format') && strtolower($this->getAttribute('format')) === 'html') {
            $classnames = 'code-highlight-figure';
            if ($this->hasAttribute('class')) {
                $classnames .= ' ' . $this->getAttribute('class');
            }

            $compiler
                ->write('$figcaption = ')
                ->string($this->getFigcaption())
                ->raw(";\n")
                ->write('echo sprintf(')
                ->raw('"<figure class=\"' . $classnames . '\">%s%s</figure>\n",')
                ->raw(' $figcaption, $highlightedCode')
                ->raw(");\n");
        } else {
            $compiler->write('echo $highlightedCode;' . "\n");
        }
    }