fix HyperText matching

This commit is contained in:
Yasuhiro Matsumoto 2023-03-07 22:35:40 +09:00
parent df0362b9ba
commit b3afe41723
No known key found for this signature in database
GPG Key ID: 622DE34DC490584B

View File

@ -35,7 +35,7 @@ export default function Text({ content, tags, creator }: TextProps) {
.map(f => { .map(f => {
if (typeof f === "string") { if (typeof f === "string") {
return splitByUrl(f).map(a => { return splitByUrl(f).map(a => {
if (a.startsWith("http")) { if (a.match(/^https?:\/\//)) {
return <HyperText key={a} link={a} creator={creator} />; return <HyperText key={a} link={a} creator={creator} />;
} }
return a; return a;