diff --git a/lib/consts.dart b/lib/consts.dart index 311434e4..e9aad70f 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -288,6 +288,7 @@ const Map>> const Map kCodeHighlighterMap = { kSubTypeHtml: "xml", + kSubTypeSvg: "xml", kSubTypeYaml: "yaml", kSubTypeYml: "yaml", kSubTypeTextYaml: "yaml", diff --git a/lib/utils/http_utils.dart b/lib/utils/http_utils.dart index 9109e8e0..0278aa5e 100644 --- a/lib/utils/http_utils.dart +++ b/lib/utils/http_utils.dart @@ -94,6 +94,9 @@ MediaType? getMediaTypeFromHeaders(Map? headers) { var subtype = mediaType.subtype; //print(mediaType); if(kResponseBodyViewOptions.containsKey(type)){ + if (kResponseBodyViewOptions[type]!.containsKey(subtype)){ + return (kResponseBodyViewOptions[type]![subtype]!, kCodeHighlighterMap[subtype] ?? subtype); + } if(subtype.contains(kSubTypeJson)){ subtype = kSubTypeJson; }