From bc762f451ad54fa8ecb28521b9f11c048588fc7e Mon Sep 17 00:00:00 2001 From: Silberengel Date: Mon, 20 Oct 2025 20:41:03 +0200 Subject: [PATCH] deal with highlights without source tags --- src/components/Note/Highlight/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/Note/Highlight/index.tsx b/src/components/Note/Highlight/index.tsx index 5e928ab..4f7db82 100644 --- a/src/components/Note/Highlight/index.tsx +++ b/src/components/Note/Highlight/index.tsx @@ -41,7 +41,17 @@ export default function Highlight({ }) } } else { - const rTag = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'source') + // First try to find r-tag with 'source' marker + let rTag = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'source') + + // If no r-tag with 'source' marker found, check if there's only one r-tag + if (!rTag) { + const rTags = event.tags.filter(tag => tag[0] === 'r') + if (rTags.length === 1) { + rTag = rTags[0] + } + } + if (rTag) { source = { type: 'url' as const,