1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:38:11 +00:00

LibWeb: make it possible to directly load .svg files

Make LibWeb load svg files by guessing the svg mime type from the file
extension and parsing it with the HTML parser.
This commit is contained in:
Simon Danner 2020-09-07 19:45:14 +02:00 committed by Andreas Kling
parent 699e1fdc07
commit 05be6481b7
2 changed files with 8 additions and 5 deletions

View file

@ -87,6 +87,8 @@ String guess_mime_type_based_on_filename(const URL& url)
return "image/bmp";
if (lowercase_url.ends_with(".jpg") || lowercase_url.ends_with(".jpeg"))
return "image/jpeg";
if (lowercase_url.ends_with(".svg"))
return "image/svg+xml";
if (lowercase_url.ends_with(".md"))
return "text/markdown";
if (lowercase_url.ends_with(".html") || lowercase_url.ends_with(".htm"))