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

goldmark: Add options footnote.BacklinkHTML, table.ClassCellLeft, table.ClassCellCenter, table.ClassCellRight #11434

Open
10maurycy10 opened this issue Sep 7, 2023 · 2 comments

Comments

@10maurycy10
Copy link

10maurycy10 commented Sep 7, 2023

Currently, the hugo configuration file can only enable or disable the Footnote extention to goldmark. The reson for this is that the allowed properties are hardcoded in hugo. The only option for Footnotes and all other extentions other then Typographer is to enable or disable it.

Idealy, this would be implemented in a way that just passes configuration to goldmark, allowing full access to goldmark configuration. If that is infeasible, simply adding more configurability to the markdown engine would be good.

@jmooring
Copy link
Member

jmooring commented Sep 7, 2023

Of the extension options that are not configurable, only one has any meaningful value by simply exposing it: WithFootnoteBacklinkHTML. This would allow you to change the back arrow below into whatever:

image

This has come up 2 or 3 times in the forum, but mostly related to the transition from Blackfriday to Goldmark several years ago (the option was exposed with Blackfriday). It's a nice-to-have, but there's little/no demand.

The table extension has a WithTableCellAlignMethod option, but simply exposing this doesn't buy us anything. We'd need to create our own options, related to TableCellAlignNone, allowing us to specify classes for left, right, and center aligned td and th elements. Currently we get this:

image

Inline styling can be blocked by CSPs, so doing something in this area is probably a good idea, at some point. But similar to WithFootnoteBacklinkHTML, this is currently just a nice-to-have.

Related: #7244

@bep bep changed the title Support configuring goldmark Footnotes and other extentions. goldmark: Add options footnote.BacklinkHTML, table.ClassCellLeft, table.ClassCellCenter, table.ClassCellRight Sep 7, 2023
@bep
Copy link
Member

bep commented Sep 7, 2023

I have made the issue title more ... to the point.

Note that doing this would require revising these options to be struct types on the same form as the cjk extension.

@bep bep added this to the v0.131.0 milestone Jul 22, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
@bep bep modified the milestones: v0.133.0, Unscheduled Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants