[html] html
template function throws error, if no tags are included
#2334
Labels
alternative templating
Related to non-JSX template engines
Describe the bug
If the
html
template function is called with a template string that doesn't contain any tags – or even with an empty template string – it throws an uncaughtTypeError: Cannot read properties of undefined (reading 'name')
This might be connected to #2299 which describes text content before the first tag being ignored. So pretending, this were the desired behaviour, a call to
html
with a string without tags equals a call with an empty template string. Still an empty string shouldn't make it fail.Your Example Website or App
https://playground.solidjs.com/anonymous/09d9efad-1d6d-4b3a-bb69-d6b24112b91f
Steps to Reproduce the Bug or Issue
Run
html`Some string without tags`
orhtml``
and it will throw an error.Expected behavior
It should just return the input as plain string (in order to generate a text node out of it).
Screenshots or Videos
No response
Platform
Tested on (but most probably not the reason for the issue):
Additional context
No response
The text was updated successfully, but these errors were encountered: