diff options
author | Simon Danner <danner.simon@gmail.com> | 2020-09-07 19:45:14 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-08 13:57:18 +0200 |
commit | 05be6481b74b9a91897ae54e38f7442c2797fd05 (patch) | |
tree | 295e3ae6c81a58a3f031517b9bf395a4d18b804f /Libraries/LibCore/MimeData.cpp | |
parent | 699e1fdc07e69419f17faa191930b5d604a9640b (diff) | |
download | serenity-05be6481b74b9a91897ae54e38f7442c2797fd05.zip |
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.
Diffstat (limited to 'Libraries/LibCore/MimeData.cpp')
-rw-r--r-- | Libraries/LibCore/MimeData.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibCore/MimeData.cpp b/Libraries/LibCore/MimeData.cpp index ffc9a698b3..02a4d49b88 100644 --- a/Libraries/LibCore/MimeData.cpp +++ b/Libraries/LibCore/MimeData.cpp @@ -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")) |