More fixes related to #363

This commit is contained in:
Zef Hemel
2023-12-19 17:55:11 +01:00
parent a5c7405a35
commit 30436d97ea
9 changed files with 70 additions and 31 deletions
+2 -6
View File
@@ -8,8 +8,7 @@ import {
import { decoratorStateField } from "./util.ts";
import type { Client } from "../client.ts";
import { resolvePath } from "$sb/lib/resolve.ts";
import { folderName, resolve } from "../../common/path.ts";
import { resolveAttachmentPath, resolvePath } from "$sb/lib/resolve.ts";
class InlineImageWidget extends WidgetType {
constructor(
@@ -77,11 +76,8 @@ export function inlineImagesPlugin(client: Client) {
let url = imageRexexResult.groups.url;
const title = imageRexexResult.groups.title;
const currentPage = client.currentPage!;
const currentFolder = folderName(currentPage);
if (url.indexOf("://") === -1 && !url.startsWith("/")) {
url = resolve(currentFolder, decodeURI(url));
url = resolveAttachmentPath(client.currentPage!, decodeURI(url));
}
widgets.push(
Decoration.widget({