-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Ship goldmark-attributes extension #7548
Comments
There is also a third option, and since CommonMark has spent a decade discussing this and @yuin did not add this to his implementation, maybe that's the most sensible option. |
Is there any way to have this working somehow at the moment? |
Trying to ping @yuin and get his opinion; I agree that it would be really useful to be able to add CSS classes to blockquotes etc. My take on this is that the CommonMark people will never agree on a spec for this, so if we look pass the "political side" of this issue; is there a technical reason why we would not want to add this? {.epigraph}
> Why, you may take the most gallant sailor, the most intrepid airman or the
> most audacious soldier, put them at a table together – what do you get? The
> sum of their fears. |
If this is added at some point, I hope it is disabled by default. Not because I don't like the idea (I do), but because separation of content and style seems like the right starting point for most projects.
EDIT: I forgot that we already (by default) allow attributes on headings, controlled by:
which allows you to set the element id, CSS classes, and additional attributes (e.g., |
The linked extension above is very low on tests/documentation, so it's hard to tell. But if we want to add this to Hugo, I suspect we would need to re-implement it, so ... up to us. But I also do agree that this would be an option -- default off. |
I agree with @bep 's opinion.
|
If all three (element id, CSS classes, and additional attributes) were possible, I would vote to control them separately. Something like:
The additionalAttributes should be limited an "allow list". And at some point someone will ask for an "allow list" for cssClasses as well. This is one of those features that has a high risk of scope creep. |
OK, reading the Goldmark code now, I notice the new |
E.g.: ``` > foo > bar {.myclass} ``` There are some current limitations: For tables you can currently only apply it to the full table, and for lists the ul/ol-nodes only, e.g.: ``` * Fruit * Apple * Orange * Banana {.fruits} * Dairy * Milk * Cheese {.dairies} {.list} ``` Fixes gohugoio#7548
E.g.: ``` > foo > bar {.myclass} ``` There are some current limitations: For tables you can currently only apply it to the full table, and for lists the ul/ol-nodes only, e.g.: ``` * Fruit * Apple * Orange * Banana {.fruits} * Dairy * Milk * Cheese {.dairies} {.list} ``` Fixes gohugoio#7548
E.g.: ``` > foo > bar {.myclass} ``` There are some current limitations: For tables you can currently only apply it to the full table, and for lists the ul/ol-nodes only, e.g.: ``` * Fruit * Apple * Orange * Banana {.fruits} * Dairy * Milk * Cheese {.dairies} {.list} ``` Fixes #7548
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
https://github.com/mdigger/goldmark-attributes
Would it be OK to ship it or should it be reimplemented in a different way for some reason?
The text was updated successfully, but these errors were encountered: