This commit is contained in:
rebornix 2022-04-04 11:29:00 -07:00
parent 12f64a68ba
commit ab2a987919
No known key found for this signature in database
GPG key ID: 181FC90D15393C20
2 changed files with 4 additions and 2 deletions

View file

@ -204,7 +204,8 @@ export const activate: ActivationFunction<void> = (ctx) => {
previewNode.classList.add('emptyMarkdownCell'); previewNode.classList.add('emptyMarkdownCell');
} else { } else {
previewNode.classList.remove('emptyMarkdownCell'); previewNode.classList.remove('emptyMarkdownCell');
const markdownText = outputInfo.mime.startsWith('text/x-') ? `\`\`\`${outputInfo.mime.substr(7)}\n${text}\n\`\`\`` : text; const markdownText = outputInfo.mime.startsWith('text/x-') ? `\`\`\`${outputInfo.mime.substr(7)}\n${text}\n\`\`\``
: (outputInfo.mime.startsWith('application/') ? `\`\`\`${outputInfo.mime.substr(12)}\n${text}\n\`\`\`` : text);
const unsanitizedRenderedMarkdown = markdownIt.render(markdownText); const unsanitizedRenderedMarkdown = markdownIt.render(markdownText);
previewNode.innerHTML = (ctx.workspace.isTrusted previewNode.innerHTML = (ctx.workspace.isTrusted
? unsanitizedRenderedMarkdown ? unsanitizedRenderedMarkdown

View file

@ -122,7 +122,8 @@
"text/x-typescript", "text/x-typescript",
"text/x-vb", "text/x-vb",
"text/x-xml", "text/x-xml",
"text/x-yaml" "text/x-yaml",
"application/json"
] ]
} }
], ],