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

Human-readable anchor values for headings #102

Closed
matsko opened this issue Aug 5, 2014 · 4 comments
Closed

Human-readable anchor values for headings #102

matsko opened this issue Aug 5, 2014 · 4 comments

Comments

@matsko
Copy link

matsko commented Aug 5, 2014

It would be really nice is to have the anchor URLs be generated as a lowercase, hyphenated version of the title text. Something like:

# Welcome to my new blog article
--> website.com/posts/page#welcome-to-my-new-blog-article

I'm currently using your library as apart of Hugo.

Here is my original post:

gohugoio/hugo#387

@dmitshur
Copy link
Collaborator

dmitshur commented Aug 5, 2014

What does blackfriday currently do instead?

Here's a func that does what you're describing.

func createSanitizedAnchorName(text string) string

@matsko
Copy link
Author

matsko commented Aug 6, 2014

I'm not a Go programmer (yet) so I get lost while looking through the code. So far I've investigated Hugo's source, but it looks like it delegates its table-of-contents-generation to markdown which then writes the heading anchors as #toc_% (where % is a number).

@NkS90
Copy link

NkS90 commented Aug 20, 2014

+1

@rtfb
Copy link
Collaborator

rtfb commented Oct 28, 2014

Fixed with #125.

@rtfb rtfb closed this as completed Oct 28, 2014
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

4 participants