Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vg-for on p tag doesn't work as expected #57

Open
bradleypeabody opened this issue Jul 22, 2019 · 1 comment
Open

vg-for on p tag doesn't work as expected #57

bradleypeabody opened this issue Jul 22, 2019 · 1 comment

Comments

@bradleypeabody
Copy link
Contributor

(From David NG on Slack)
I followed the guide on https://www.vugu.org/doc/files/markup, and gets ./root.go:81:28: undefined: i for the example code:

    <p vg-for='i := 0; i < 10; i++'>
        <div vg-html="i"></div>
    </p>
</div>```
@bradleypeabody
Copy link
Contributor Author

Wow, that’s an interesting one. It looks like the HTML parser that parses .vugu files (which in turn uses golang.org/x/net/html) is ending up with something unexpected in relation to that <p> tag. If you change it from a <p> tag to a <div> everything works as expected. It probably has to do with some obscure thing in the HTML docs about how

tags are only supposed to contain text and so the parser cleans it up in some way - perhaps by moving the div outside of the p, or something. Regardless, this is definitely unexpected behavior from a developer’s perspective. If you can please file an issue that would be helpful. But for an immediate workaround, just use a different tag name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant