diff --git a/package.json b/package.json index 57709a1..37553d3 100644 --- a/package.json +++ b/package.json @@ -410,7 +410,7 @@ "package": "vsce package" }, "dependencies": { - "@shd101wyy/mume": "^0.3.0" + "@shd101wyy/mume": "^0.3.1" }, "devDependencies": { "@types/jquery": "^3.2.17", diff --git a/src/config.ts b/src/config.ts index aff3207..3265b90 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,5 +1,6 @@ import * as vscode from "vscode" import {MarkdownEngineConfig} from "@shd101wyy/mume" +import { MathRenderingOption } from "../../mume/out/src/markdown-engine-config"; export class MarkdownPreviewEnhancedConfig implements MarkdownEngineConfig { public static getCurrentConfig() { @@ -15,7 +16,7 @@ export class MarkdownPreviewEnhancedConfig implements MarkdownEngineConfig { public readonly enableExtendedTableSyntax: boolean public readonly enableCriticMarkupSyntax: boolean public readonly frontMatterRenderingOption:string - public readonly mathRenderingOption: string + public readonly mathRenderingOption: MathRenderingOption public readonly mathInlineDelimiters: Array public readonly mathBlockDelimiters: Array public readonly codeBlockTheme: string @@ -50,7 +51,7 @@ export class MarkdownPreviewEnhancedConfig implements MarkdownEngineConfig { this.enableCriticMarkupSyntax = config.get('enableCriticMarkupSyntax') this.frontMatterRenderingOption = config.get('frontMatterRenderingOption') this.mermaidTheme = config.get('mermaidTheme') - this.mathRenderingOption = config.get('mathRenderingOption') + this.mathRenderingOption = config.get('mathRenderingOption') as MathRenderingOption this.mathInlineDelimiters = config.get>('mathInlineDelimiters') this.mathBlockDelimiters = config.get>('mathBlockDelimiters') this.codeBlockTheme = config.get('codeBlockTheme') diff --git a/src/preview-content-provider.ts b/src/preview-content-provider.ts index 5263118..f74c2b5 100644 --- a/src/preview-content-provider.ts +++ b/src/preview-content-provider.ts @@ -106,7 +106,7 @@ export class MarkdownPreviewEnhancedView implements vscode.TextDocumentContentPr return "" } else { editor.edit((edit)=> { - edit.insert(new vscode.Position(i+1, 0), `\n\n${result}\n\n\n`) + edit.insert(new vscode.Position(i+1, 0), `\n\n\n${result}\n\n\n`) }) return "" } @@ -116,9 +116,8 @@ export class MarkdownPreviewEnhancedView implements vscode.TextDocumentContentPr for (let i = 0; i < visibleTextEditors.length; i++) { const editor = visibleTextEditors[i] if (editor.document.uri.fsPath === filePath) { - let codeChunkOffset = 0, - targetCodeChunkOffset = codeChunkData.options['code_chunk_offset'] + targetCodeChunkOffset = codeChunkData.normalizedInfo.attributes['code_chunk_offset'] const lineCount = editor.document.lineCount for (let i = 0; i < lineCount; i++) {