From 500c91e054391325f469854be63425c01b3a43b9 Mon Sep 17 00:00:00 2001 From: Kaede Fujisaki Date: Fri, 2 Jun 2023 17:34:22 +0900 Subject: [PATCH] Render link if exists --- server/src/renderer/MomentRenderer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/renderer/MomentRenderer.ts b/server/src/renderer/MomentRenderer.ts index c007296..7de6817 100644 --- a/server/src/renderer/MomentRenderer.ts +++ b/server/src/renderer/MomentRenderer.ts @@ -68,8 +68,14 @@ class MomentRenderer { height = Math.min(2048, entity.height); width = entity.width * height / entity.height; } + let url: string; + if (!!block.link) { + url = block.link; + } else { + url = `/entity/${escapeAttribute(block.entity)}`; + } return ` - + an image. `.trim();