This reverts commit 07948ae7bc.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4cdf239139
Коммит
c54ab6da21
@@ -318,10 +318,6 @@ func getFirstLinkAndImages(str string) (string, []string) {
|
|||||||
if firstLink == "" {
|
if firstLink == "" {
|
||||||
firstLink = v.Destination()
|
firstLink = v.Destination()
|
||||||
}
|
}
|
||||||
case *markdown.InlineLink:
|
|
||||||
if firstLink == "" {
|
|
||||||
firstLink = v.Destination()
|
|
||||||
}
|
|
||||||
case *markdown.InlineImage:
|
case *markdown.InlineImage:
|
||||||
images = append(images, v.Destination())
|
images = append(images, v.Destination())
|
||||||
case *markdown.ReferenceImage:
|
case *markdown.ReferenceImage:
|
||||||
|
|||||||
@@ -1294,11 +1294,11 @@ func TestGetFirstLinkAndImages(t *testing.T) {
|
|||||||
ExpectedFirstLink: "https://example.com",
|
ExpectedFirstLink: "https://example.com",
|
||||||
ExpectedImages: []string{"https://example.com/logo"},
|
ExpectedImages: []string{"https://example.com/logo"},
|
||||||
},
|
},
|
||||||
"markdown links": {
|
"markdown links (not returned)": {
|
||||||
Input: `this is a [our page](http://example.com) and [another page][]
|
Input: `this is a [our page](http://example.com) and [another page][]
|
||||||
|
|
||||||
[another page]: http://www.exaple.com/another_page`,
|
[another page]: http://www.exaple.com/another_page`,
|
||||||
ExpectedFirstLink: "http://example.com",
|
ExpectedFirstLink: "",
|
||||||
ExpectedImages: []string{},
|
ExpectedImages: []string{},
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user