Revert "[MM-29224] Fix bug where markdown image link doesn't show preview (#15862)" (#16326)

This reverts commit 07948ae7bc.
Этот коммит содержится в:
Harrison Healey
2020-11-20 11:23:21 -05:00
коммит произвёл GitHub
родитель 4cdf239139
Коммит c54ab6da21
2 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

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

Просмотреть файл

@@ -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{},
},
} {