HapticX / happyx

Macro-oriented asynchronous web-framework written in Nim with ♥
https://hapticx.github.io/happyx/
MIT License
540 stars 18 forks source link

Spurious divs without style as "display: contents;" 🐛 #324

Closed quimt closed 3 months ago

quimt commented 3 months ago

Describe the bug 🐛 In #295 discussion seemed to conclude that the enclosing div would be removed from buildHtml. It seems to be back in the current commit.

To Reproduce 👨‍🔬


component Hello:
  html:
    tDiv:
      "hello"

let b = buildHtml:
  Hello

let c = buildHtml:
  tDiv:
    "hello"

appRoutes("ROOT"):
  "/":
    tDiv: {$b}
    tDiv: {$c}

image

Ethosa commented 3 months ago

Hmm, seems like a just new found bug, because it works with buildHtmls, not with buildHtml 👀

Ethosa commented 3 months ago

buildHtml always returns all children as a onlye one element - div with onlyChildren: true, so:

buildHtml:
  tDiv:
    {$c}
    c

return this: image