From 4cbb8da3454a18c7a3597d768f653b8f987ae6d7 Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Sat, 14 Oct 2023 11:24:35 +0200 Subject: [PATCH] Fix dot after mention parsing --- src/components/ParsedNote/ParsedNote.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/ParsedNote/ParsedNote.tsx b/src/components/ParsedNote/ParsedNote.tsx index 90ca74c..d89de72 100644 --- a/src/components/ParsedNote/ParsedNote.tsx +++ b/src/components/ParsedNote/ParsedNote.tsx @@ -41,7 +41,7 @@ import NoteImage from '../NoteImage/NoteImage'; import { createStore } from 'solid-js/store'; import { linebreakRegex } from '../../constants'; -const specialChars = [",", "?", ";", "!", "'"]; +const specialChars = [",", "?", ";", "!", "'", "."]; const ParsedNote: Component<{ note: PrimalNote, @@ -218,12 +218,26 @@ const ParsedNote: Component<{ } if (isNoteMention(token)) { - const [_, id] = token.split(':'); + let [_, id] = token.split(':'); if (!id) { return token; } + let end = ''; + + for (let i=0; i= 0) { + end = id.slice(index); + id = id.slice(0, index); + break; + } + } + let link = {token}; try {