Skip to content

Commit

Permalink
Merge pull request #520 from writefreely/slug-improvements
Browse files Browse the repository at this point in the history
Elide Markdown when generating slug
  • Loading branch information
thebaer committed Dec 29, 2021
2 parents 8c1785b + 69ab0d3 commit 401c8c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions posts.go
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,8 @@ func getSlug(title, lang string) string {

func getSlugFromPost(title, body, lang string) string {
if title == "" {
// Remove Markdown, so e.g. link URLs and image alt text don't make it into the slug
body = strings.TrimSpace(stripmd.StripOptions(body, stripmd.Options{SkipImages: true}))
title = postTitle(body, body)
}
title = parse.PostLede(title, false)
Expand Down

0 comments on commit 401c8c1

Please sign in to comment.