I got the problem that on a Grav site, I get a new empty line at the start of every document. With the sitemap plugin installed, I get this error on /sitemap.xml:

This is because there is an empty line at the start of the document:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/user/plugins/sitemap/sitemap.xsl"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
>
...
Every other page, html, xml, ... get this empty line too, and I don't know why. On other sites with the almost same config and plugins (same theme with some customizations), there is no error.
After some playing around, I found out that this error only happens if the shortcode-core plugin is installed. But this can't be the main reason, since other sites have this plugin installed too and there is no error. There must be a different cause of the problem.