solidjs / solid-meta

Write meta tags to the document head
127 stars 16 forks source link

Quotes in attribute values aren't escaped when calling renderTags #21

Closed niko-roether closed 1 year ago

niko-roether commented 1 year ago

Inserting quotes in the value of an attribute will break the HTML that is returned by renderTags.

For example, for a Meta element like this:

<Meta name="..." content={'Text in "quotes"'} />

the result of renderTags will include the unsanitized value for content as-is, resulting in:

<meta name="..." content="Text in"quotes"">

At first glance, I would consider this a bug, since the expected behaviour for JSX is that HTML sanitization, such as escaping quotes in attribute values, is handled for you.