cferdinandi / reef

A lightweight library for creating reactive, state-based components and UI.

Home Page:https://reefjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue in setting alt tag when there is a quotation mark in text

sajidalianjum opened this issue · comments

It's a very good library! I am using it for a project. I recently updated Reef from 8 to 11. I just found an issue in v11 that if you set a text having quotation mark in alt tag then it breaks the html. You can try the following codepen, inspect the image tag in the html and you can find that it is breaking.

Test case: https://codepen.io/saanjum/pen/YzrYVPN

Image: https://i.ibb.co/k0rW7T1/alt-tag.png

P.S. I can solve it by cleaning the text before assigning it to alt tag but just wanted to check what do you think is the best solution as it was not happening in v8.

Hi there, this is unfortunately a limitation of how the DOMParser() API (browser native) works, and I cannot implement a fix in Reef to address it.