Transform data coming from FS to regular and usable HTML
Install with composer.
composer require frontkom/fs-info-transformer
use Frontkom\FsInfoTransformer\Transformer;
$transformer = new Transformer();
$text = 'Vi viser til <webLink><href>https://www.example.com</href><linkName>gjeldende forskrift og tilhørende retningslinjer.</linkName></webLink>';
$html = $transformer->transform($text);
echo $html;
// Will output
// Vi viser til <a rel="nofollow" href="https://www.example.com">gjeldende forskrift og tilhørende retningslinjer.</a>
Transforms the given text to HTML.
This method will run all the most common transformations on the text, including most of the ones below. For a direct link to read the implementation, see the method in the source code directly.
GPL-2.0-or-later