From d4107c9a56645555b256349bce75230ccd3071dd Mon Sep 17 00:00:00 2001 From: gnacho Date: Sun, 13 Sep 2026 21:01:34 +0200 Subject: [PATCH] feat(tasks): render [[SHORT-ID]] as a link between tasks (#241) --- app/src/components/Markdown.tsx | 32 +++++++--- app/src/components/TaskRef.tsx | 28 +++++++++ app/src/data/DataProvider.tsx | 4 ++ app/src/data/data-context.ts | 2 + app/src/i18n/locales/en/translation.json | 1 + app/src/i18n/locales/es/translation.json | 1 + app/src/lib/task-refs.ts | 78 ++++++++++++++++++++++++ 7 files changed, 136 insertions(+), 10 deletions(-) create mode 100644 app/src/components/TaskRef.tsx create mode 100644 app/src/lib/task-refs.ts diff --git a/app/src/components/Markdown.tsx b/app/src/components/Markdown.tsx index e309c5f..ca1ad0a 100644 --- a/app/src/components/Markdown.tsx +++ b/app/src/components/Markdown.tsx @@ -1,6 +1,8 @@ -import ReactMarkdown from 'react-markdown'; +import ReactMarkdown, { defaultUrlTransform } from 'react-markdown'; import remarkGfm from 'remark-gfm'; import remarkBreaks from 'remark-breaks'; +import TaskRef from '@/components/TaskRef'; +import { TASK_REF_SCHEME, remarkTaskRefs } from '@/lib/task-refs'; /** Quita la prop `node` que react-markdown pasa a cada renderer, para no * esparcirla sobre el elemento del DOM. */ @@ -15,21 +17,31 @@ function withoutNode(props: T): Omit { * `