1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-24 08:22:29 +02:00

minimum changes required (#1763)

This commit is contained in:
Hossein 2021-11-09 14:50:54 -05:00 committed by GitHub
parent f74eea11ba
commit 520f1e65e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,9 +292,8 @@ func postWithBoardsEmbed(post *mmModel.Post, showBoardsUnfurl bool) *mmModel.Pos
// Trim away the first / because otherwise after we split the string, the first element in the array is a empty element
urlPath := u.Path
if strings.HasPrefix(urlPath, "/") {
urlPath = u.Path[1:]
}
urlPath = strings.TrimPrefix(urlPath, "/")
urlPath = strings.TrimSuffix(urlPath, "/")
pathSplit := strings.Split(strings.ToLower(urlPath), "/")
queryParams := u.Query()
@ -337,6 +336,13 @@ func getFirstLink(str string) string {
if _, ok := blockOrInline.(*markdown.Autolink); ok {
if link := blockOrInline.(*markdown.Autolink).Destination(); firstLink == "" {
firstLink = link
return false
}
}
if inlineLink, ok := blockOrInline.(*markdown.InlineLink); ok {
if link := inlineLink.Destination(); firstLink == "" {
firstLink = link
return false
}
}
return true