diff --git a/Sources/DocCHTML/MarkdownRenderer.swift b/Sources/DocCHTML/MarkdownRenderer.swift
index 8ee60d8db9..14d28f2e2d 100644
--- a/Sources/DocCHTML/MarkdownRenderer.swift
+++ b/Sources/DocCHTML/MarkdownRenderer.swift
@@ -844,7 +844,7 @@ private extension CharacterSet {
.union(CharacterSet(charactersIn: "`")) // Also consider back-ticks as punctuation. They are used as quotes around symbols or other code.
.subtracting(CharacterSet(charactersIn: "-")) // Don't remove hyphens. They are used as a whitespace replacement.
static let whitespaceAndDashes = CharacterSet.whitespaces
- .union(CharacterSet(charactersIn: "-–—")) // hyphen, en dash, em dash
+ .union(CharacterSet(charactersIn: "-\u{2013}\u{2014}")) // hyphen, en dash, em dash
}
/// Creates a more readable version of a fragment by replacing characters that are not allowed in the fragment of a URL with hyphens.
diff --git a/Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver.swift b/Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver.swift
index 1bac256aab..7d134981a6 100644
--- a/Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver.swift
+++ b/Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver.swift
@@ -337,7 +337,7 @@ private func linkName(filename: some StringProtocol) -> String {
}
private let whitespaceAndDashes = CharacterSet.whitespaces
- .union(CharacterSet(charactersIn: "-–—")) // hyphen, en dash, em dash
+ .union(CharacterSet(charactersIn: "-\u{2013}\u{2014}")) // hyphen, en dash, em dash
private extension PathHierarchy.Node {
func matches(languagesFilter: SmallSourceLanguageSet) -> Bool {
diff --git a/Sources/SwiftDocC/Model/Identifier.swift b/Sources/SwiftDocC/Model/Identifier.swift
index b6f66561f2..2e62153f28 100644
--- a/Sources/SwiftDocC/Model/Identifier.swift
+++ b/Sources/SwiftDocC/Model/Identifier.swift
@@ -642,7 +642,7 @@ private extension CharacterSet {
.union(CharacterSet(charactersIn: "`")) // Also consider back-ticks as punctuation. They are used as quotes around symbols or other code.
.subtracting(CharacterSet(charactersIn: "-")) // Don't remove hyphens. They are used as a whitespace replacement.
static let whitespaceAndDashes = CharacterSet.whitespaces
- .union(CharacterSet(charactersIn: "-–—")) // hyphen, en dash, em dash
+ .union(CharacterSet(charactersIn: "-\u{2013}\u{2014}")) // hyphen, en dash, em dash
}
/// Creates a more readable version of a fragment by replacing characters that are not allowed in the fragment of a URL with hyphens.