fix: mailto
This commit is contained in:
@@ -20,10 +20,15 @@ const LinkifyText = ({ url = true, mention = true, mentionTextOnly = false, ment
|
|||||||
return (
|
return (
|
||||||
<Linkify options={
|
<Linkify options={
|
||||||
{
|
{
|
||||||
// attributes: {
|
|
||||||
// onClick: handleLinkClick
|
|
||||||
// },
|
|
||||||
render: {
|
render: {
|
||||||
|
email: ({ content, attributes: { href: link } }) => {
|
||||||
|
if (mentionTextOnly) return <>
|
||||||
|
{content}
|
||||||
|
</>;
|
||||||
|
return <a className="link" href={link} rel="noreferrer">
|
||||||
|
{content}
|
||||||
|
</a>;
|
||||||
|
},
|
||||||
url: ({ content, attributes: { href: link } }) => {
|
url: ({ content, attributes: { href: link } }) => {
|
||||||
console.log("attr", link);
|
console.log("attr", link);
|
||||||
if (!url) return <>{content}</>;
|
if (!url) return <>{content}</>;
|
||||||
@@ -31,7 +36,7 @@ const LinkifyText = ({ url = true, mention = true, mentionTextOnly = false, ment
|
|||||||
<a className="link" target="_blank" href={link} rel="noreferrer">
|
<a className="link" target="_blank" href={link} rel="noreferrer">
|
||||||
{content}
|
{content}
|
||||||
</a>
|
</a>
|
||||||
{!link.startsWith("mailto") && <URLPreview url={link} />}
|
<URLPreview url={link} />
|
||||||
</>;
|
</>;
|
||||||
},
|
},
|
||||||
mention: ({ content }) => {
|
mention: ({ content }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user