mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Misc
This commit is contained in:
parent
109c0790d2
commit
245fffbce1
|
@ -93,7 +93,7 @@ enum CellOutputMimeTypes {
|
|||
stdout = 'application/vnd.code.notebook.stdout'
|
||||
}
|
||||
|
||||
const textMimeTypes = ['text/plain', 'text/markdown', CellOutputMimeTypes.stderr, CellOutputMimeTypes.stdout];
|
||||
export const textMimeTypes = ['text/plain', 'text/markdown', 'text/latex', CellOutputMimeTypes.stderr, CellOutputMimeTypes.stdout];
|
||||
|
||||
function concatMultilineString(str: string | string[], trim?: boolean): string {
|
||||
const nonLineFeedWhiteSpaceTrim = /(^[\t\f\v\r ]+|[\t\f\v\r ]+$)/g;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import { nbformat } from '@jupyterlab/coreutils';
|
||||
import { NotebookCellData, NotebookCellKind, NotebookCellOutput } from 'vscode';
|
||||
import { CellOutputMetadata } from './common';
|
||||
import { textMimeTypes } from './deserializers';
|
||||
|
||||
const textDecoder = new TextDecoder();
|
||||
|
||||
|
@ -15,8 +16,6 @@ enum CellOutputMimeTypes {
|
|||
stdout = 'application/vnd.code.notebook.stdout'
|
||||
}
|
||||
|
||||
const textMimeTypes = ['text/plain', 'text/markdown', CellOutputMimeTypes.stderr, CellOutputMimeTypes.stdout];
|
||||
|
||||
export function createJupyterCellFromNotebookCell(
|
||||
vscCell: NotebookCellData
|
||||
): nbformat.IRawCell | nbformat.IMarkdownCell | nbformat.ICodeCell {
|
||||
|
|
|
@ -15,6 +15,7 @@ export namespace Mimes {
|
|||
export const binary = 'application/octet-stream';
|
||||
export const unknown = 'application/unknown';
|
||||
export const markdown = 'text/markdown';
|
||||
export const latex = 'text/latex';
|
||||
}
|
||||
|
||||
export interface ITextMimeAssociation {
|
||||
|
|
|
@ -217,7 +217,7 @@ class MdRendererContrib extends Disposable implements IOutputRendererContributio
|
|||
}
|
||||
|
||||
getMimetypes() {
|
||||
return [Mimes.markdown];
|
||||
return [Mimes.markdown, Mimes.latex];
|
||||
}
|
||||
|
||||
constructor(
|
||||
|
|
|
@ -1155,7 +1155,7 @@ async function webviewPreloads(ctx: PreloadContext) {
|
|||
|
||||
await renderers.render(this, this.element);
|
||||
|
||||
if (this.mime === 'text/markdown') {
|
||||
if (this.mime === 'text/markdown' || this.mime === 'text/latex') {
|
||||
const root = this.element.shadowRoot;
|
||||
if (root) {
|
||||
if (!hasPostedRenderedMathTelemetry) {
|
||||
|
|
|
@ -37,6 +37,7 @@ export const NOTEBOOK_DISPLAY_ORDER = [
|
|||
'application/javascript',
|
||||
'text/html',
|
||||
'image/svg+xml',
|
||||
Mimes.latex,
|
||||
Mimes.markdown,
|
||||
'image/png',
|
||||
'image/jpeg',
|
||||
|
@ -44,6 +45,7 @@ export const NOTEBOOK_DISPLAY_ORDER = [
|
|||
];
|
||||
|
||||
export const ACCESSIBLE_NOTEBOOK_DISPLAY_ORDER = [
|
||||
Mimes.latex,
|
||||
Mimes.markdown,
|
||||
'application/json',
|
||||
Mimes.text,
|
||||
|
@ -567,6 +569,7 @@ const _mimeTypeInfo = new Map<string, MimeTypeInfo>([
|
|||
['image/git', { alwaysSecure: true, supportedByCore: true }],
|
||||
['image/svg+xml', { supportedByCore: true }],
|
||||
['application/json', { alwaysSecure: true, supportedByCore: true }],
|
||||
[Mimes.latex, { alwaysSecure: true, supportedByCore: true }],
|
||||
[Mimes.markdown, { alwaysSecure: true, supportedByCore: true }],
|
||||
[Mimes.text, { alwaysSecure: true, supportedByCore: true }],
|
||||
['text/html', { supportedByCore: true }],
|
||||
|
|
|
@ -24,6 +24,7 @@ suite('NotebookCommon', () => {
|
|||
'application/javascript',
|
||||
'text/html',
|
||||
'image/svg+xml',
|
||||
Mimes.latex,
|
||||
Mimes.markdown,
|
||||
'image/png',
|
||||
'image/jpeg',
|
||||
|
@ -34,6 +35,7 @@ suite('NotebookCommon', () => {
|
|||
'application/javascript',
|
||||
'text/html',
|
||||
'image/svg+xml',
|
||||
Mimes.latex,
|
||||
Mimes.markdown,
|
||||
'image/png',
|
||||
'image/jpeg',
|
||||
|
@ -44,6 +46,7 @@ suite('NotebookCommon', () => {
|
|||
assert.deepStrictEqual(sortMimeTypes(
|
||||
[
|
||||
'application/json',
|
||||
Mimes.latex,
|
||||
Mimes.markdown,
|
||||
'application/javascript',
|
||||
'text/html',
|
||||
|
@ -57,6 +60,7 @@ suite('NotebookCommon', () => {
|
|||
'application/javascript',
|
||||
'text/html',
|
||||
'image/svg+xml',
|
||||
Mimes.latex,
|
||||
Mimes.markdown,
|
||||
'image/png',
|
||||
'image/jpeg',
|
||||
|
|
Loading…
Reference in a new issue