-
Notifications
You must be signed in to change notification settings - Fork 13
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 comment event #55
Comments
Yes, comments are mostly inaccessible from the events right now. I agree that As comments are tightly coupled with attributes, one way could perhaps be to text{a=b %cmt% c=d} currently yields
but could perhaps yield something like
where comments are a special type of attribute key-values. Attribute keys are
to distinguish comments from attributes. Also, dangling attribute sets that are not attached to anything are currently text {a=b %cmt% c=d} {%cmt only%} currently yields
but we actually want to access the comments here. We could perhaps add an empty
Any thoughts/suggestions on how to represent the comments? |
I like the But consider:
Currently yields:
%= might not be enough here. |
Attributes are internally implemented as Vec, so it is possible to have multiple comments and also maintain their order among the attributes. However, Attributes are currently destructive for classes and key-value pairs as well, e.g.
For renderers it is convenient to get concatenated classes and only single attributes, but you lose information about the original source. Might be possible to preserve the original set completely (including comments) while also providing a way to iterate over only concatenated classes, single attributes and no comments. Might need some experimentation with the API. |
As for formatter, I think
|
I gave it a try with #56. I couldn't think of a good way to add comments in attributes with the current map-like structure so I tried turning it into a list/vec structure that more resembles the input, that preserves duplicate keys, comments and their order. Any thoughts on this proposal? |
Comments are available in events as of release 0.5.0. |
I want to write a formatter for
djot
. So, I want to keep the original comment.But
jotdown
do not produce event for comment.The text was updated successfully, but these errors were encountered: