Custom Kirbytag, multiple lines

Iā€™m building a custom Kirbytag for a client project:

// simplyfied code:
'link' => [
  'attr' => [
    'text',
  ],
  'html' => function ($tag) {
    return '<a href="' . $tag->value. '">' . svg('assets/images/link.svg')  . $tag->text . '</a>';
  }
],

It seems like the tags content is parsed by markdown because the line breaks in the svg lead to <br> and <p> elements scattered everywhere. For now I manually removed all of the breaks from the SVG file but it should be changeable by the client at some point.

Can I somehow prevent this from happening?