Merge pull request #520 from writefreely/slug-improvements

Elide Markdown when generating slug
This commit is contained in:
Matt Baer 2021-12-29 17:51:42 -05:00 committed by GitHub
commit 401c8c1f4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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)