Skip to content
Open
Show file tree
Hide file tree
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
39 changes: 39 additions & 0 deletions doc/syntax.html
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,45 @@ <h3>Inline attributes</h3>
</code></pre>
</div>
</div>
<p>To attach attributes to a list item, the curly braces must immediately
follow the list marker:</p>
<div class="example">
<div class="djot">
<pre><code>+{.blue} A blue list item.
(a){.bar} Ordered list item with an attribute.</code></pre>
</div>
<div class="html">
<pre><code>&lt;ul&gt;
&lt;li class=&quot;blue&quot;&gt;
A blue list item.
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol type=&quot;a&quot;&gt;
&lt;li class=&quot;bar&quot;&gt;
Ordered list item with an attribute.
&lt;/li&gt;
&lt;/ol&gt;
</code></pre>
</div>
</div>
<p>Conversely, in the following, the attributes are attached to the block
quote:</p>
<div class="example">
<div class="djot">
<pre><code>+ {.blue}
&gt; A blue quote.</code></pre>
</div>
<div class="html">
<pre><code>&lt;ul&gt;
&lt;li&gt;
&lt;blockquote class=&quot;blue&quot;&gt;
A blue quote.
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
</div>
</div>
</section>
</section>
<section id="block-syntax" class="level2">
Expand Down
12 changes: 12 additions & 0 deletions doc/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,18 @@ is the same as

avant{lang=fr .blue}

To attach attributes to a list item, the curly braces must immediately
follow the list marker:

+{.blue} A blue list item.

@Omikhleia Omikhleia Jan 14, 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.

What is the expected interpretation for the marker? How does one apply attributes on a given list marker only?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess directly attaching is also fine from parser rules. And would probably make sense.
But if you look at my implementation (and the linked docs examples), you will see that it improves human readability if in this case those are put into the item as appended new line.
And I think one important goal is the readability for humans in the end, in this case the "list" itself.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sure, I'd be fine with that.

@tmke8 tmke8 May 19, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Maybe open a new spec PR with your proposed syntax? Then it's easier to compare and discuss.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have plenty of open PRs that got almost no review or even any initial minimal feedback.
I would like to first see the maintainer(s) chiming in giving their 5 cents, before I would open up any spec + reference impl PR.

(a){.bar} Ordered list item with an attribute.

Conversely, in the following, the attributes are attached to the block
quote:

+ {.blue}
> A blue quote.

## Block syntax

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