From 10f5af5ddac932018f7082ba7b033512bd199834 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Fri, 10 Sep 2021 01:35:46 +0530 Subject: [PATCH] feat: codemirror editot for raw body --- components/http/RawBody.vue | 135 ++++++++++++++++++------------------ helpers/editorutils.js | 14 ++-- 2 files changed, 75 insertions(+), 74 deletions(-) diff --git a/components/http/RawBody.vue b/components/http/RawBody.vue index 308db5df..6a440f46 100644 --- a/components/http/RawBody.vue +++ b/components/http/RawBody.vue @@ -56,81 +56,82 @@
- +
- diff --git a/helpers/editorutils.js b/helpers/editorutils.js index 0955bbf3..9dd46a4b 100644 --- a/helpers/editorutils.js +++ b/helpers/editorutils.js @@ -1,12 +1,12 @@ const mimeToMode = { - "text/plain": "plain_text", - "text/html": "html", - "application/xml": "xml", - "application/hal+json": "json", - "application/vnd.api+json": "json", - "application/json": "json", + "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", } export function getEditorLangForMimeType(mimeType) { - return mimeToMode[mimeType] || "plain_text" + return mimeToMode[mimeType] || "text/x-yaml" }