Skip to content

Commit 4ce641b

Browse files
committed
Use unicode literals to clarify that 3 different characters are added to the set
1 parent 2a1a7bd commit 4ce641b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Sources/DocCHTML/MarkdownRenderer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ private extension CharacterSet {
844844
.union(CharacterSet(charactersIn: "`")) // Also consider back-ticks as punctuation. They are used as quotes around symbols or other code.
845845
.subtracting(CharacterSet(charactersIn: "-")) // Don't remove hyphens. They are used as a whitespace replacement.
846846
static let whitespaceAndDashes = CharacterSet.whitespaces
847-
.union(CharacterSet(charactersIn: "-–—")) // hyphen, en dash, em dash
847+
.union(CharacterSet(charactersIn: "-\u{2013}\u{2014}")) // hyphen, en dash, em dash
848848
}
849849

850850
/// Creates a more readable version of a fragment by replacing characters that are not allowed in the fragment of a URL with hyphens.

Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ private func linkName(filename: some StringProtocol) -> String {
337337
}
338338

339339
private let whitespaceAndDashes = CharacterSet.whitespaces
340-
.union(CharacterSet(charactersIn: "-–—")) // hyphen, en dash, em dash
340+
.union(CharacterSet(charactersIn: "-\u{2013}\u{2014}")) // hyphen, en dash, em dash
341341

342342
private extension PathHierarchy.Node {
343343
func matches(languagesFilter: SmallSourceLanguageSet) -> Bool {

Sources/SwiftDocC/Model/Identifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ private extension CharacterSet {
642642
.union(CharacterSet(charactersIn: "`")) // Also consider back-ticks as punctuation. They are used as quotes around symbols or other code.
643643
.subtracting(CharacterSet(charactersIn: "-")) // Don't remove hyphens. They are used as a whitespace replacement.
644644
static let whitespaceAndDashes = CharacterSet.whitespaces
645-
.union(CharacterSet(charactersIn: "-–—")) // hyphen, en dash, em dash
645+
.union(CharacterSet(charactersIn: "-\u{2013}\u{2014}")) // hyphen, en dash, em dash
646646
}
647647

648648
/// Creates a more readable version of a fragment by replacing characters that are not allowed in the fragment of a URL with hyphens.

0 commit comments

Comments
 (0)