solidjs / solid-meta

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

Fix commas in SSR with multiple text children #5

Closed marvinhagemeister closed 2 years ago

marvinhagemeister commented 2 years ago

This PR addresses an issue in renderTags where commas are inserted out of nowhere. This happens because the code assumes that there will only ever be one child node. When it receives multiple text nodes there is an implicit array to string conversion which then inserts the comma.

const company = "My cool company"

<Title>blabla - {company}</Title>

Old output:

<title>blabla - ,My cool company</title>

With this PR:

<title>blabla - My cool company</title>

Not sure if just checking via Array.isArray is the idiomatic way to check for singular vs multiple children in solid.

ryansolid commented 2 years ago

Thank you.