lpil / html-lustre-converter

HTML -> Lustre
https://lpil.github.io/html-lustre-converter/
27 stars 7 forks source link

`<script>` tag incorrect conversion #16

Open guillheu opened 1 day ago

guillheu commented 1 day ago

When converting

<script type="module" src="/priv/static/my_project.mjs">const val = 0</script>

The resulting Gleam code :

  html.html([], [
    html.head([], [
      html.script(
        [
          attribute.src("/priv/static/my_project.mjs"),
          attribute.type_("module"),
        ],
        [html.text("const val = 0")],
      ),
    ]),
    html.body([], []),
  ])

... incorrectly uses the function html.script

Instead of html.script([ <attributes> ], [html.text(" <js script content> ")]) it should be html.script([ <attributes> ], " <js script content> "), using the raw script content string instead of an array of html.text.

lpil commented 19 hours ago

Thank you