diff --git a/Changelog.md b/Changelog.md index 693e9ac6..7a9b2027 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,9 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed listing of function parameters, when generating CommonMark documentation. #170 by @domcorvasce. - - Fixed version number for swift-doc command. #159 by @mattt. +- Fixed relationship diagram to prevent linking to unknown symbols. + #178 by @MattKiazyk. ## [1.0.0-beta.4] - 2020-07-31 diff --git a/Sources/swift-doc/Extensions/SwiftDoc+Extensions.swift b/Sources/swift-doc/Extensions/SwiftDoc+Extensions.swift index 114b9ed6..fac1bcd4 100644 --- a/Sources/swift-doc/Extensions/SwiftDoc+Extensions.swift +++ b/Sources/swift-doc/Extensions/SwiftDoc+Extensions.swift @@ -60,7 +60,10 @@ extension Symbol { for symbol in Set(relationships.flatMap { [$0.subject, $0.object] }) { guard self != symbol else { continue } var node = symbol.node - node.href = path(for: symbol, with: baseURL) + + if !(symbol.api is Unknown) { + node.href = path(for: symbol, with: baseURL) + } graph.append(node) }