superside-oss / sanity-copy-paste

MIT License
8 stars 1 forks source link

Support for custom marks in <PortableText> #4

Open angelinekwan opened 7 months ago

angelinekwan commented 7 months ago

Thank you for working on this awesome plugin! Such a time saving feature. We encounter an issue with the Portable text that contains a custom mark for link as following:

Clicking on the Remove disallowed marks will remove the error but also it will also remove the link.

Screenshot 2024-02-15 at 12 46 51

This is the example of code for the PortableText. Any idea how we can support this in the paste component? Thanks in advance.

<PortableText
    value={value}
    components={{
        marks: {
            link: ({ value, children }) => {
                return (
                    <Link
                        to={value?.href}
                    >
                        {children}
                    </Link>
                );
            },
        },
    }}
/>