From adb0897704cd09aeea8f9fb5c37106805299d2f9 Mon Sep 17 00:00:00 2001 From: sjoulbak Date: Mon, 4 Mar 2024 14:46:27 +0100 Subject: [PATCH] fix: detect svgs with title as image/svg+xml intead of text/html This issue is introduced after merging #74 and released at 1.0.3. The title element provides an accessible, short-text description of the SVG and so cannot be used to determine whether an element is text/html. --- lib/marcel/tables.rb | 2 +- test/fixtures/magic/image/svg+xml/svg_with_title.svg | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/magic/image/svg+xml/svg_with_title.svg diff --git a/lib/marcel/tables.rb b/lib/marcel/tables.rb index 52e0290..5deb463 100644 --- a/lib/marcel/tables.rb +++ b/lib/marcel/tables.rb @@ -2399,7 +2399,7 @@ module Marcel ['image/bmp', [[0, b['BM'], [[26, b["\001\000"], [[28, b["\000\000"]], [28, b["\001\000"]], [28, b["\004\000"]], [28, b["\b\000"]], [28, b["\020\000"]], [28, b["\030\000"]], [28, b[" \000"]]]]]]]], ['image/vnd.adobe.photoshop', [[0, b["8BPS\000\001"]], [0, b["8BPS\000\002"]]]], ['image/webp', [[0, b['RIFF'], [[8, b['WEBP']]]]]], - ['text/html', [[0..64, b[' + SVG with title +