2020-02-24 04:23:18 +00:00
|
|
|
const mimeToMode = {
|
2021-09-09 20:05:46 +00:00
|
|
|
"text/plain": "text/x-yaml",
|
|
|
|
|
"text/html": "htmlmixed",
|
|
|
|
|
"application/xml": "application/xml",
|
|
|
|
|
"application/hal+json": "application/ld+json",
|
|
|
|
|
"application/vnd.api+json": "application/ld+json",
|
|
|
|
|
"application/json": "application/ld+json",
|
2020-02-24 04:23:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getEditorLangForMimeType(mimeType) {
|
2021-09-09 20:05:46 +00:00
|
|
|
return mimeToMode[mimeType] || "text/x-yaml"
|
2020-02-24 04:23:18 +00:00
|
|
|
}
|