-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Standalone attributes #258
Comments
Interesting point. As a workaround you could use a thematic break with class attributes and hide it with CSS
(This may have the advantage to make the intent explicit, vs. mistakenly having inserted a standalone attribute in the source?) |
Thanks! It's also possible with the current syntax for inline attributes using However, I think this harms the readability, so the workaround might work in some context, but in a context where you need to add standalone attributes quite often, it is not ideal.
In my opinion, in:
the intent that attributes are standalone looks already explicit, rather than being attached to paragraph 2! That said, there is a problem of backward compatibility, and anyone used to the current syntax might not see the intent the same as me... (In my specific case, I am implementing those features on top of another markdown parser (cmarkit) to have a syntax tailored to my (quite specific) needs. So, while I'm sad creating yet another markup variant, I am not tied to djot, and if no-one else needs this syntax, I understand if djot stays as it is!) |
Practically, I’d use a symbol here, By definition, attributes attach to a node in a document tree. A node which is empty and is used only for its attributes is a reasonable construct, but it seems that it should have some non-empty syntax for readability. And using a symbol for an empty block/inline element makes sense syntactically. |
Good idea, I did no think of using a symbol for my specific use-case. About standalone attributes, if I understand correctly your suggestion is to have "empty nodes", represented by some non-empty syntax (more precisely, a symbol), and then attach this empty node with an inline attribute. So for standalone block attributes:
and for standalone inline attributes
Is that right? |
I don't see the use of this. You can attach attributes to an empty span or empty fenced div if you want. But attributes are semantically attributes of something. |
About the use-case: I'd like to use a markup language for a presentation framework where there are a lot of But I agree with all the points here! Maybe I'm taking the wrong approach. In any case, I think the fact that
drops the |
Hello !
I have another question about attributes. Why isn't it possible to have a floating/standalone attribute: an attribute that is not attached to anything?
For instance (assuming flag attributes),
would render in html as:
For reference:
So, currently the example above would render:
The text was updated successfully, but these errors were encountered: