diff --git a/app/post_metadata.go b/app/post_metadata.go index f6b1550d45..02b98fd291 100644 --- a/app/post_metadata.go +++ b/app/post_metadata.go @@ -318,10 +318,6 @@ func getFirstLinkAndImages(str string) (string, []string) { if firstLink == "" { firstLink = v.Destination() } - case *markdown.InlineLink: - if firstLink == "" { - firstLink = v.Destination() - } case *markdown.InlineImage: images = append(images, v.Destination()) case *markdown.ReferenceImage: diff --git a/app/post_metadata_test.go b/app/post_metadata_test.go index 4c2ca457d9..1cbf3a9f0f 100644 --- a/app/post_metadata_test.go +++ b/app/post_metadata_test.go @@ -1294,11 +1294,11 @@ func TestGetFirstLinkAndImages(t *testing.T) { ExpectedFirstLink: "https://example.com", ExpectedImages: []string{"https://example.com/logo"}, }, - "markdown links": { + "markdown links (not returned)": { Input: `this is a [our page](http://example.com) and [another page][] [another page]: http://www.exaple.com/another_page`, - ExpectedFirstLink: "http://example.com", + ExpectedFirstLink: "", ExpectedImages: []string{}, }, } {