fixed sanitazer and academy

This commit is contained in:
2026-06-05 16:53:20 +02:00
parent 15870ddb1f
commit f89ee937c0
29 changed files with 2444 additions and 1039 deletions

View File

@@ -327,4 +327,26 @@
@if($needsXEmbeds)
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
@endif
<script>
// Make inline article images open with the same preview used for cover images.
(function () {
function attachStoryImagePreview() {
document.querySelectorAll('.story-prose img').forEach(function (img) {
if (!img) return;
if (!img.hasAttribute('data-news-image-preview')) {
img.setAttribute('data-news-image-preview', '');
img.setAttribute('data-news-image-src', img.getAttribute('src') || img.getAttribute('data-src') || '');
img.setAttribute('data-news-image-alt', img.getAttribute('alt') || img.getAttribute('aria-label') || 'Image preview');
}
});
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', attachStoryImagePreview);
} else {
attachStoryImagePreview();
}
})();
</script>
@endpush