Skip to content

Commit

Permalink
fix re groups (#92)
Browse files Browse the repository at this point in the history
* fix re groups
  • Loading branch information
bingryan authored Aug 6, 2024
1 parent 4d29b5f commit 72bc351
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
nodejs: [12, 14]
nodejs: [18, 20]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 1 addition & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];

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

0 comments on commit 72bc351

Please sign in to comment.