solid icon indicating copy to clipboard operation
solid copied to clipboard

[solid-js/html] `attr:foo="123"` in `html` template outputs as verbatim `attr:foo="123"`, inconsistent with JSX

Open trusktr opened this issue 1 year ago • 2 comments

Describe the bug

This JSX code,

function Example() {
	return <some-el attr:foo="123">inspect element</some-el>
}

outputs the attribute foo="123" to the DOM, as expected.

JSX playground example

This html template,

function Example() {
	return html`<some-el attr:foo="123">inspect element</some-el>`
}

outputs verbatim attr:foo="123" to the DOM.

html playground example

Your Example Website or App

https://playground.solidjs.com/anonymous/3f8870fa-ecb7-4222-b81c-abec2a56b6b3

Steps to Reproduce the Bug or Issue

see playground

Expected behavior

Expect behavior to be consistent across JSX and html.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

trusktr avatar Dec 23 '23 21:12 trusktr

It seems the html takes whatever you put into the dom. Should we use the standard html here? in you case, remove the attr, use html <some-el foo="123">inspect element</some-el> ?

takeramagan avatar Jan 01 '24 15:01 takeramagan

Yeah this just was never added probably. HTML renderer was something I created a couple days back in 2018 (I think) and over time got updates because the runtime improved. We probably should look at adding this.

ryansolid avatar Jan 03 '24 05:01 ryansolid