Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions doc/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ Inside the curly braces, the following syntax is possible:
are not needed when the value consists entirely of ASCII alphanumeric
characters or `_` or `:` or `-`. Backslash escapes may be used inside
quoted values.
- A bare `key` (a word consisting of ASCII alphanumeric characters,
`_`, or `-`, not followed by `=`) specifies a boolean attribute. This
is equivalent to `key=""` and maps to HTML boolean attributes such as

@Omikhleia Omikhleia Feb 5, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really, HTML is one possible output only. If mentioned in a general specification of a markup, it's at best as an example.
This being said, why would it be equivalent to key=""` (an empty string value is not necessarily a boolean in a general context)?

@dereuromark dereuromark Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also write it as key="key"
The HTML5 specs are interesting here, and a bit weird at first glance for sure.
But they bool concept is quite handy and useful in such places here. I think it also works as agnostic one, or translated well enough to it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... the only agnostic and semantically clear way would be, for me, key (standalone) being equivalent to key=true.
A HTML renderer may interpret key=true as key in output, and remove key=false, but that's an HTML concept (that doesn't really makes any sense beyond a weird historical reason from SGML to HTML etc.). No?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The good thing about the bool attr is that we do not need to care about the verbose form per "end use", incl HTML. We just use the simple bool form and it just works tm :)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And key="" is really what it is, an empty string (not simplified)

@dereuromark dereuromark Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need at this point to debate this.
The bool attribute is exactly why this discussion becomes void then, solving it cleanly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need at this point to debate this.

I am not sure I understand what you mean here, the PR says:

This is equivalent to key=""

I don't think this has to be the case. And if not debated now (for some reason), then it shouldn't be mentioned. Or did I miss the point?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ignore that part. That's html5 specific and not relevant for General usage. My bad.

`disabled`, `hidden`, `reversed`, `open`, and `download`.
- `%` begins a comment, which ends with the next `%` or the end of the
attribute (`}`).

Expand All @@ -350,6 +354,15 @@ is the same as

avant{lang=fr .blue}

Boolean attributes can be combined freely with other attribute types:

[Download](file.zip){download .btn}

{reversed}
1. Third
2. Second
3. First

## Block syntax

As in commonmark, block structure can be discerned prior to inline
Expand Down