<p></p>
<p>I wasn't aware of this particular error, but I've wrestled with html in our flash messages before and it's a bit of a nightmare.</p>
<p>Rails flash <a href="https://api.rubyonrails.org/classes/ActionDispatch/Flash.html" rel="nofollow">only allows</a> <code>String</code>, <code>Array</code> and <code>Hash</code> as flash objects, notably not <code>SafeBuffer</code>. So if we output the raw string (via <code>raw</code> or marking it as <code>.html_safe</code>) then we get problems like <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="99646015" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/1027" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/1027/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/1027">#1027</a> . If we let rails escape the <code>String</code>, then we get problems like this issue.</p>
<p>I'm not sure what the best approach is, so any suggestions are welcome.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3215#issuecomment-856888164">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLC3UGSLRGB322DCTDTRY34HANCNFSM46KAKGUA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLMMQFBTOCYJELZ662LTRY34HA5CNFSM46KAKGUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGMJRGZA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3215#issuecomment-856888164",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3215#issuecomment-856888164",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>