How to add a link to the original URL below the embedded content

If you want to display a link to the original page below the embedded content, the appendTemplate() method can be called (before adding media sites) to set a template to be displayed after the embedded content.

$configurator = new s9e\TextFormatter\Configurator;

    '<a href="{@url}"><xsl:value-of select="@url"/></a>'

// Get an instance of the parser and the renderer

$text = '';
$xml  = $parser->parse($text);
$html = $renderer->render($xml);

echo $html;
<span data-s9e-mediaembed="youtube" style="display:inline-block;width:100%;max-width:640px"><span style="display:block;overflow:hidden;position:relative;padding-bottom:56.25%"><iframe allowfullscreen="" scrolling="no" style="background:url( 50% 50% / cover;border:0;height:100%;left:0;position:absolute;width:100%" src=""></iframe></span></span><a href=""></a>