Skip to content

Commit fde6d09

Browse files
committed
1 parent 14d3a4b commit fde6d09

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

extensions/markdown-language-features/notebook/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ export const activate: ActivationFunction<void> = (ctx) => {
204204
previewNode.classList.add('emptyMarkdownCell');
205205
} else {
206206
previewNode.classList.remove('emptyMarkdownCell');
207-
const markdownText = outputInfo.mime.startsWith('text/x-') ? `\`\`\`${outputInfo.mime.substr(7)}\n${text}\n\`\`\`` : text;
207+
const markdownText = outputInfo.mime.startsWith('text/x-') ? `\`\`\`${outputInfo.mime.substr(7)}\n${text}\n\`\`\``
208+
: (outputInfo.mime.startsWith('application/') ? `\`\`\`${outputInfo.mime.substr(12)}\n${text}\n\`\`\`` : text);
208209
const unsanitizedRenderedMarkdown = markdownIt.render(markdownText);
209210
previewNode.innerHTML = (ctx.workspace.isTrusted
210211
? unsanitizedRenderedMarkdown

extensions/markdown-language-features/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
"text/x-typescript",
123123
"text/x-vb",
124124
"text/x-xml",
125-
"text/x-yaml"
125+
"text/x-yaml",
126+
"application/json"
126127
]
127128
}
128129
],

0 commit comments

Comments
 (0)