Best way to handle <a> tags output from a WYSIWYG? #16342
Unanswered
milesjbland
asked this question in
Help
Replies: 1 comment
-
This becomes quite useful when pulling in CMS content with the upcoming changes to Link where it can infer the page to use. https://twitter.com/timneutkens/status/1295355450846846976 Ideally you'd be able to do something like
And it'd figure out if it's an internal link and make them |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a best practice solution for handling
<a>
tags output from a WYSIWYG editor in Next?A potential solution is to wrap the output in a component that maps through each child element and changes any with a type of
a
to a Next link.The issue is this relies on a few packages, such as react-children-utilities, and I'm not sure if the hit to performance from the extra weight and processing is worth any perceived gain from the links.
Beta Was this translation helpful? Give feedback.
All reactions