From c54ab6da211af861b25af1364518e549d3a1ed91 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 20 Nov 2020 11:23:21 -0500 Subject: [PATCH] Revert "[MM-29224] Fix bug where markdown image link doesn't show preview (#15862)" (#16326) This reverts commit 07948ae7bc9019fa84ea49e61f5ac86a62da0ad8. --- app/post_metadata.go | 4 ---- app/post_metadata_test.go | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) 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{}, }, } {