whamtet / simpleui

JS Free Single Page Applications
https://whamtet.github.io/simpleui/
Eclipse Public License 2.0
247 stars 15 forks source link

How to deal with a component that returns html? #35

Open jave opened 3 weeks ago

jave commented 3 weeks ago

I have a component that calls an api that returns html.

I would like to render that html, but when I use the hx-target method, the target component renders the html tags verbatim, rather than formated. If I reload the entire page, the html gets rendered though.

Since the documentation states that a component should return hiccup syntax, not html, I guess html might not be supported?

But how should I then deal with it? convert html to hiccup first?

TIA

whamtet commented 3 weeks ago

How about we make it so that components can return a string? The html response will become that string.

whamtet commented 2 weeks ago

Any thoughts @jave ?