add user page

This commit is contained in:
Ren Amamiya
2023-06-28 17:23:36 +07:00
parent 3fe601cfc6
commit ec1ff9ab87
27 changed files with 492 additions and 491 deletions

View File

@@ -2,10 +2,11 @@ import { MentionUser } from "@shared/notes/mentions/user";
import destr from "destr";
import getUrls from "get-urls";
import { parseReferences } from "nostr-tools";
import { ReactNode } from "react";
import { Link } from "react-router-dom";
import reactStringReplace from "react-string-replace";
function isJsonString(str) {
function isJsonString(str: string) {
try {
JSON.parse(str);
} catch (e) {
@@ -24,7 +25,7 @@ export function parser(event: any) {
const content: {
original: string;
parsed: any;
parsed: ReactNode[];
notes: string[];
images: string[];
videos: string[];
@@ -39,9 +40,11 @@ export function parser(event: any) {
};
// remove unnecessary whitespaces
// @ts-ignore
content.parsed = content.parsed.replace(/\s{2,}/g, " ");
// remove unnecessary linebreak
// @ts-ignore
content.parsed = content.parsed.replace(/(\r\n|\r|\n){2,}/g, "$1\n");
// parse urls