HapticX / happyx

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

text tags not working in svg šŸ› #321

Closed quimt closed 3 months ago

quimt commented 3 months ago

Describe the bug šŸ› Two things are happening:

  1. An extra 't' beyond the usual seems to be needed to disambiguate the tag.
  2. Even when the string value of the TagRef is valid html, the TagRef fails to render with a text node inside it.

To Reproduce šŸ‘Øā€šŸ”¬

let A = buildHtml: tSvg(viewBox="0 0 240 80"): ttText(x="35",y="20", style="fill: black;"): "A: Anyone Here?"

let B = buildHtml: tSvg(viewBox="0 0 240 80"): tText(x="35",y="20", style="fill: black;"): "B: Anyone Here?"

let C = buildHtml: tSvg(viewBox="0 0 240 80"): text(x="35",y="20", style= "fill: black;"): "C: Anyone Here?"

appRoutes("ROOT"): "/": {$A} {A} {$B} {B} {$C} {C}

Expected behavior šŸ¤” We'd normally expect B and C to produce valid svg given how we expect an extra 't' to work on tags in the SPA

Only A does instead. Even though the string value indicates A produces valid svg, it fails to render anything.

Screenshots šŸ–¼ image

Please complete the following information šŸ“ƒ spa, current head version, 4.4.1

Ethosa commented 3 months ago

Solved in the next commit