Skip to the content.

Installation

Install this library using composer

composer require ansi-to-html-twig-extension

Register the extension in your Twig environment

$twig->addExtension(new \Twig\Extension\AnsiToHtmlExtension());

Twig Token Parser

The Twig token parser provides the ansitohtml tag :

$twig->addTokenParser(new \Twig\TokenParser\AnsiToHtmlTokenParser());