fix re groups (#92)

* fix re groups
This commit is contained in:
bingryan 2024-08-06 22:54:43 +08:00 committed by GitHub
parent 4d29b5fb50
commit 72bc351c43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 6 deletions

View file

@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
nodejs: [12, 14]
nodejs: [18, 20]
steps:
- uses: actions/checkout@v2

View file

@ -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);

View file

@ -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;'`