I want to put this:
<p>Use the following style in a MapLibre map:</p>
<pre
id="style-url-pre"><code id="style-url-code">https://tiles.openfreemap.org/styles/liberty</code></pre>
under an if-block:
{
showStyleURL && (
<>
<p>Use the following style in a MapLibre map:</p>
<pre
id="style-url-pre"><code id="style-url-code">https://tiles.openfreemap.org/styles/liberty</code></pre>
</>
)
}
My problem is that as soon as it's under an if-block, the formatter breaks it by entering a new line between the pre and the code which breaks the DOM.
{
showStyleURL && (
<>
<p>Use the following style in a MapLibre map:</p>
<pre id="style-url-pre">
<code id="style-url-code">https://tiles.openfreemap.org/styles/liberty</code>
</pre>
</>
)
}
Both of my GitHub issues got closed as duplicate / not planned.
https://github.com/withastro/prettier-plugin-astro/issues/419
and
https://github.com/withastro/prettier-plugin-astro/issues/420
I'd just like to have those lines ignored, but the rest of the file still working, of course. Can you help me find any workarounds? So far my only idea is to make a separate component for that 3 lines.