Allow page id references with section
This commit is contained in:
@ -56,6 +56,11 @@ extension String {
|
||||
return parts.dropLast().joined(separator: separator) + content + separator + parts.last!
|
||||
}
|
||||
|
||||
/**
|
||||
Remove everything behind the first separator.
|
||||
|
||||
Also removes the separator itself. If the separator is not contained in the string, then the full string is returned.
|
||||
*/
|
||||
func dropAfterFirst<T>(_ separator: T) -> String where T: StringProtocol {
|
||||
components(separatedBy: separator).first!
|
||||
}
|
||||
|
Reference in New Issue
Block a user