<p dir="auto">Now data uri svgs are used throughout the map key, and they affect the generated file size.</p>
<p dir="auto">The default <code class="notranslate">url_encode</code> function %-encodes too many characters. There's a question which ones have to be encoded. <code class="notranslate">#</code> certainly is one of them, unencoded <code class="notranslate">#</code> will break the uri. If you strictly follow <a href="https://www.ietf.org/rfc/rfc2397.txt" rel="nofollow">the rfc from 1998</a>, spaces need to be encoded, yet nobody does that with svgs. For example <a href="https://github.com/tigt/mini-svg-data-uri/blob/00dc78c8f77eb7b47299a9e3d564749105810c9c/index.js#L31">this library here</a> deliberately unencodes them. <code class="notranslate"><></code> are commonly encoded by svg data uri libraries, yet the example in Wikipedia <a href="https://en.wikipedia.org/wiki/Data_URI_scheme" rel="nofollow">contains them unencoded</a> and it seems to work fine.</p>
<p dir="auto">I'm %-encoding <a href="https://github.com/yoksel/url-encoder/blob/2c31ea619932c61f418bb8dfb945ddc95f9927fd/src/js/script.js#L15C44-L15C44">these chars</a> as used in <a href="https://yoksel.github.io/url-encoder/" rel="nofollow">this tool</a>.</p>
<p dir="auto">Before:</p>
<pre class="notranslate"><code class="notranslate"><img src="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2752%27%20height%3D%271%27%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20fill%3D%27%23787878%27%20%2F%3E%3C%2Fsvg%3E" />
</code></pre>
<p dir="auto">After:</p>
<pre class="notranslate"><code class="notranslate"><img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='1'%3E%3Crect width='100%25' height='100%25' fill='%23787878' /%3E%3C/svg%3E">
</code></pre>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/4419'>https://github.com/openstreetmap/openstreetmap-website/pull/4419</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4419/commits/ab0ec21657df554e202ce3be13ba85a8051c7b4d" class="commit-link">ab0ec21</a>  Add solid svg image helper</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4419/commits/98bd7ad0094457dac95b74e78754819462f72065" class="commit-link">98bd7ad</a>  Do less %-encoding of data uri svgs</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4419/commits/5a1f5591bf6fcdf54ae6e09eeee76c33c19b6ded" class="commit-link">5a1f559</a>  Don't html-escape single quotes in data uri svgs</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4419/files">2 files</a>)</p>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4419/files#diff-a7200a046015d139f9fe11372e33e7ba1a24250c7866568da5dc13db54f3e33f">app/helpers/svg_helper.rb</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4419/files#diff-1ed86bfa2aa7755d8f1f78574beceeb01b246a86beed16f43eb4d286f35667a9">app/views/site/key.html.erb</a>
    (2)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4419.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4419.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4419.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4419.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4419">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLP4AYWMYQQPLA66KQDYKBGWJAVCNFSM6AAAAABAZTOL3GVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DMNZXHE2DCMA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOIBNID2LV2BXGADDTYKBGWJA5CNFSM6AAAAABAZTOL3GWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHT73ACI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4419</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4419",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4419",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>