feat: only replace the mention syntax within the p tag

This commit is contained in:
DIYgod
2023-04-15 06:17:42 +01:00
parent ee47a59bc6
commit d7a9c1dc1b
5 changed files with 51 additions and 10 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ export const ConnectButton: React.FC<{
icon: "i-mingcute:home-1-line",
label: t("My xLog") || "",
url: getSiteLink({
subdomain: userSites.data?.[0].username || "",
subdomain: userSites.data?.[0]?.username || "",
}),
},
{
+1 -4
View File
@@ -1,5 +1,4 @@
import { FC, useEffect, useState } from "react"
import { useTranslation } from "react-i18next"
import { useIsDark } from "~/hooks/useDarkMode"
import { useIsUnmounted } from "~/hooks/useLifecycle"
import { nanoid } from "nanoid"
@@ -52,11 +51,9 @@ export const Mermaid: FC<{
}
}, [props.children])
const { t } = useTranslation("common")
return loading ? (
<div className="h-[50px] rounded-lg flex items-center justify-center bg-[#ECECFD] dark:bg-[#1F2020] text-sm">
Mermaid {t("Loading")}...
Mermaid Loading...
</div>
) : svg ? (
<div dangerouslySetInnerHTML={{ __html: svg }} />