Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upTypographic elements in heading are excluded from the automatically generated heading IDs #46
Comments
This comment has been minimized.
This comment has been minimized.
I have this in my ox-hugo project that exports Org mode files to Hugo (Blackfriday/Goldmark) compatible Markdown files.. this function auto generates slugs or anchors for headings in a post: https://github.com/kaushalmodi/ox-hugo/blob/4c0ae850518c45e010a3d7253e78087c098b2fca/ox-hugo.el#L1816 You don't need to know lisp to read that code. But if you read the doc string of that function, can Goldmark adapt something like that? |
This comment has been minimized.
This comment has been minimized.
@sungchang-ha @kaushalmodi If I follow ox-hugo spec, others may say "goldmark generates header ids that does not suit my preference". So it may be better that users can add your own auto generation logic by options. |
This comment has been minimized.
This comment has been minimized.
The ox-hugo function was just for reference. If you look at this discussion on Hugo Discourse:
may be there can be some agreement on which is more readable:
At the very least, can one or more consecutive spaces and other non alphanumeric chars be replaced with a single hyphen? |
This comment has been minimized.
This comment has been minimized.
@kaushalmodi |
This comment has been minimized.
This comment has been minimized.
@yuin Seems like my reply came across in a wrong way. My suggestion has nothing to do with Hugo. I am just suggesting to introduce more hyphens to separate the words in the anchors so that they are more readable. But this is your pet project so I cannot push any further. I hope that you provide a hook or something so that Hugo can customize the anchor generation logic. Thanks for working on this better Markdown parser and your replies in these issue threads. |
This comment has been minimized.
This comment has been minimized.
@kaushalmodi Thanks for your suggestion, I'll add an option that allow you to change the auto heading id generation logic. I'm not sure about readability of heading ids, I'm thinking about the proposal. Anyway, I'm Japanese(using CJK characters), so auto generated heading ids are ususally just a meaningless strings :( |
This comment has been minimized.
This comment has been minimized.
@kaushalmodi @sungchang-ha I've tweaked logics and added an |
This comment has been minimized.
This comment has been minimized.
@kaushalmodi Thanks for the follow-up discussion on this. |
Hello,
For background and related discussion, please see the following post in Hugo forum.
https://discourse.gohugo.io/t/difference-in-auto-generated-heading-anchor-names-between-previous-versions-and-v0-60-x/22076
Please answer the following before submitting your issue:
command-gen-instance
andv1-0-0-apr-21-2019
)commandgeninstance
andv100-april-21-2019
)Many thanks for your work with Goldmark.