mirror of
https://github.com/bingryan/obsidian-markdown-export-plugin.git
synced 2026-07-22 07:10:24 +00:00
parent
4d29b5fb50
commit
72bc351c43
3 changed files with 4 additions and 6 deletions
2
.github/workflows/lint-and-build.yml
vendored
2
.github/workflows/lint-and-build.yml
vendored
|
|
@ -8,7 +8,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
nodejs: [12, 14]
|
||||
nodejs: [18, 20]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ import { MarkdownRenderer, MarkdownView } from 'obsidian';
|
|||
import MarkdownExportPlugin from "./main";
|
||||
|
||||
export default async function markdownToHTML(plugin: MarkdownExportPlugin, inputFile: string, inputContent: string) {
|
||||
// @ts-ignore
|
||||
let activeView = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
// @ts-ignore
|
||||
const leaf = app.workspace.getLeaf(true);
|
||||
if (!activeView) {
|
||||
activeView = new MarkdownView(leaf);
|
||||
|
|
|
|||
|
|
@ -344,11 +344,6 @@ export async function tryCopyMarkdownByRead(
|
|||
for (const index in imageLinks) {
|
||||
const rawImageLink = imageLinks[index][0];
|
||||
|
||||
const { width, height } = imageLinks[index].groups as {
|
||||
width: string | null;
|
||||
height: string | null;
|
||||
};
|
||||
|
||||
const urlEncodedImageLink =
|
||||
imageLinks[index][7 - imageLinks[index].length];
|
||||
|
||||
|
|
@ -385,6 +380,7 @@ export async function tryCopyMarkdownByRead(
|
|||
}
|
||||
|
||||
if (plugin.settings.displayImageAsHtml) {
|
||||
const { width = null, height = null } = imageLinks[index]?.groups || {};
|
||||
const style =
|
||||
width && height
|
||||
? ` style='width: {${width}}px; height: ${height}px;'`
|
||||
|
|
|
|||
Loading…
Reference in a new issue