(n ast.Node)
| 302 | } |
| 303 | |
| 304 | func linkDestination(n ast.Node) (dest string, isEmbed bool, ok bool) { |
| 305 | switch v := n.(type) { |
| 306 | case *ast.Image: |
| 307 | return string(v.Destination), true, true |
| 308 | case *ast.Link: |
| 309 | return string(v.Destination), false, true |
| 310 | } |
| 311 | return "", false, false |
| 312 | } |
| 313 | |
| 314 | // linkReferenceDefinitions indexes every one in the document by its |
| 315 | // destination. One inside a code fence or a code span is not parsed as a |