From 31918eb5f62826db3ff699e43b3de7bbfc3189cd Mon Sep 17 00:00:00 2001 From: Marc Satkowski Date: Sat, 5 Apr 2025 22:44:20 +0200 Subject: [PATCH] changed the way how images are rendered as strings --- src/cellParser/parser/checkbox.ts | 2 +- src/cellParser/parser/image.ts | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/cellParser/parser/checkbox.ts b/src/cellParser/parser/checkbox.ts index 61fcfd9..b46f438 100644 --- a/src/cellParser/parser/checkbox.ts +++ b/src/cellParser/parser/checkbox.ts @@ -93,7 +93,7 @@ export class CheckboxParser implements CellFunction { renderAsString(values: Args): string { if (!isCheckboxProp(values)) { - if (!!values[0]) { + if (values[0]) { return '[x]' } return '[ ]' diff --git a/src/cellParser/parser/image.ts b/src/cellParser/parser/image.ts index e201864..5bbf0b7 100644 --- a/src/cellParser/parser/image.ts +++ b/src/cellParser/parser/image.ts @@ -53,14 +53,8 @@ export class ImageParser implements CellFunction { renderAsString([href, path]: Args): string { if (!isLinkLocal(href)) { return `![](${href})` + } else { + return `![[${href}]]` } - - try { - const resourcePath = this.getResourcePath(href, path) - return `![[${resourcePath}]]` - } catch (e) { - return e.toString() - } - } } \ No newline at end of file