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

Support value-less attributes #8

Open
tkluck opened this issue Apr 26, 2020 · 3 comments
Open

Support value-less attributes #8

tkluck opened this issue Apr 26, 2020 · 3 comments

Comments

@tkluck
Copy link
Owner

tkluck commented Apr 26, 2020

As reported by @mlhetland in #6. They suggest attr=nothing as a possible way of expressing this, but I'm not sure that's very intuitive as other empty values (e.g. []) mean that the attribute should not be rendered at all. Suggestions welcome.

@mlhetland
Copy link

Well, if you don’t rely directly on named tuple syntax, you could simply permit valueless keys directly in HAML. (How it’s implemented behind the scenes is then less important; you could use some other sentinel than nothing – one internal to HAML.jl?)

@mlhetland
Copy link

Also: It doesn’t seem like a general, intuitive “emptiness” is predictive of being hidden , as using an empty string still renders the attribute (with an empty value).

@tkluck
Copy link
Owner Author

tkluck commented Apr 26, 2020

I like your first suggestion: just support it at a syntax level like

%script(defer)

which doesn't seem to conflict with anything else. Internally, after parsing, it makes sense to use some sentinel singleton as you say.

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

2 participants