Why am I getting an `SVG pane cannot parse string`error

I have been playing with python code that takes tex and produces an SVG that I can render in the notebook.
The SVG starts with

<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="154.739pt" height="114.294pt" viewBox="0 0 154.739 114.294" version="1.1">\n

trying to pass this text string to pn.pane.SVG(svg, width=300, height=200)
yields a cannot parse string error.
If instead I write the string to a file and call pn.pane.SVG with the file name instead,
the call succeeds!

Any comments on how to fix this?

Hi @ea42gh

I took a look at the SVG implementation.

I think it would work if you remove the <?xml version="1.0" encoding="UTF-8"?>\n part.

If it does please consider posting a feature request to get this done automatically and/ or contributing a PR to fix this.