isRemoteDestination reports whether a destination addresses somewhere other than the filesystem, so that an attached file is never confused with a URI. A one letter scheme is a Windows volume rather than a scheme, which keeps "C:\pictures\login.png" a path. A host with no scheme is the protocol rel
(dest string)
| 408 | // relative form, which inherits the scheme of the page it sits on. Anything too |
| 409 | // malformed to parse is left to the path lookup, which will not match it. |
| 410 | func isRemoteDestination(dest string) bool { |
| 411 | u, err := url.Parse(dest) |
| 412 | if err != nil { |
| 413 | return false |
| 414 | } |
| 415 | return len(u.Scheme) > 1 || u.Host != "" |
| 416 | } |
| 417 | |
| 418 | // candidatePaths returns the ways a destination could name a file on disk. |
| 419 | // goldmark reports the destination alone, without the angle brackets or the |
no outgoing calls
no test coverage detected