clean up and fix errors

This commit is contained in:
Ren Amamiya
2023-04-19 08:50:32 +07:00
parent c72798507e
commit 697caca77b
13 changed files with 83 additions and 78 deletions

View File

@@ -37,7 +37,7 @@ export const contentParser = (noteContent, noteTags) => {
</span>
));
// handle mentions
if (tags.length > 0) {
if (tags && tags.length > 0) {
parsedContent = reactStringReplace(parsedContent, /\#\[(\d+)\]/gm, (match) => {
if (tags[match][0] === 'p') {
// @-mentions