Skip to content
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

Multiple classes together are not parsed as attributes #98

Open
calebeby opened this issue Sep 21, 2024 · 3 comments
Open

Multiple classes together are not parsed as attributes #98

calebeby opened this issue Sep 21, 2024 · 3 comments

Comments

@calebeby
Copy link

{.foo}
hi

produces

doc
  para class="foo"
    str text="hi"

as expected. But if I add a second class:

{.foo.bar}
hi

It produces text instead of classes:

doc
  para
    str text="{.foo.bar}"
    soft_break
    str text="hi"

It looks like the documentation says multiple classes should be allowed in this way.

@calebeby
Copy link
Author

I was looking through the tests and I saw that there are tests for multiple classes written like this: {.foo .bar}. That seems to work! The haskell implementation supports {.foo.bar} but the JS one does not. Is that syntax intended to be supported? If not, can we update the documentation to give an example of multiple classes? I had assumed they would be combined like .foo.bar since that is how you would specify multiple classes together in CSS selectors.

@jgm
Copy link
Owner

jgm commented Sep 21, 2024

The intent was to require a space, but this is something to think about. Note that pandoc -f markdown treats {.foo.bar} as a single class foo.bar, djot.js fails to parse this as an attribute at all, and pandoc -f djot treats it as two classes.

Similar questions could be raised about things like .foo#baz and key=val#baz.

@calebeby
Copy link
Author

I think requiring a space is fine since that is how you separate other attributes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants