srcSet with URLs that have commas #78
-
I'm running into an issue where it seems like image srcSet properties aren't getting correctly parsed when the URLs include commas. The HTML string I'm working with includes image URLs that have commas (,) within them, particularly Cloudinary URLs, such as: This includes responsive images via srcSet, like:
The issue is when running this HTML through rehype-parse, it doesn't correctly parse the values, returning an array for srcSet like:
When later recombined, the srcSet property then includes additional spaces which then prevent the images from working because of the commas:
I'm currently solving this by escaping the commas any time I run the parser, which feels a bit hacky.
I'm wondering if there's a better approach to this or if it's a bug in how it's being parsed? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Who is doing the parsing and how? |
Beta Was this translation helpful? Give feedback.
Who is doing the parsing and how?