Yes, I mostly agree as well. Although as @mofosyne says 4. should be reformulated to either say that:
- the first of several attributes with the same name takes precedence: affects also
{dir=rtl dir=auto}
, or - it’s the author’s responsibility (similar to 6.), which I actually prefer to make implementations easier.
I’d probably rather white-list elements that may contain attributes than saying “all of them can”. What about block quotes, lists, list items, hard line breaks or even inline HTML?
We may also want to restrict the {}
to its own line at the end of a (nonempty) paragraph (RTL use case) or block quote to enhance readability and make clashes even more unlikely:
This is a paragraph with a lot of text. That's why it's somewhat hard to make out there is an attribute attached to it unless it's on another line.
{.some-class}
> This is a block quote.
> {.some-class}
To attach attributes to the entire list I guess this could work:
- item one
- item two
{.some-class}
But adding attributes to individual list items seems very tricky. How do you know whether the target is the last list item or the entire list? (Or even the last paragraph of the last list item?) It might be possible to distinguish these using indentation, but unless someone comes up with a good use case, I think we should not support attributes on list items to avoid confusion. Of course, you could argue that if the {}
doesn’t have to be on its own line (like I just proposed) it would be somewhat easier to attach it to list items, but I’m not sure it’s worth the trouble.