Issue with handling `<img />` tags in `htmlToBlocks` function from `@sanity/block-tools`.
Last updated: Nov 3, 2023
Hello all, I'm using
and can't figure out how to handle
tags that are in the HTML.It's being used for a content migration tool and I have everything in place to download assets from the previous site, upload them into Sanity and refer to it from documents. But when I convert HTML to Portable Text using
tags.Can I somehow add support for it or is it an option I have to enable somewhere? Do I need to try something funky like replace
in the HTML with
<a href />
with a particular className and then fix it in the resulting JSON so it turns into an image? Appreciate any input on this!
Oct 24, 2023, 5:47 PM
Have you created a
for handling them? What does your code look like so far?
Oct 25, 2023, 4:31 PM
Now that you point it out, I see the documentation on
!I'm digging into that. Thanks!
Oct 26, 2023, 7:32 AM
That was the missing link. Got it fixed now.Thank you so much for your reply!! 🙏