External files, improve page generation
This commit is contained in:
@ -9,6 +9,16 @@ extension String {
|
||||
.replacingOccurrences(of: ">", with: ">")
|
||||
}
|
||||
|
||||
var removingSurroundingQuotes: String {
|
||||
if hasPrefix("\"") && hasSuffix("\"") {
|
||||
return dropBeforeFirst("\"").dropAfterLast("\"")
|
||||
}
|
||||
if hasPrefix("'") && hasSuffix("'") {
|
||||
return dropBeforeFirst("'").dropAfterLast("'")
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
var nonEmpty: String? {
|
||||
isEmpty ? nil : self
|
||||
}
|
||||
@ -30,7 +40,7 @@ extension String {
|
||||
/**
|
||||
Remove the part after the last occurence of the separator (including the separator itself).
|
||||
|
||||
The string is left unchanges, if it does not contain the separator.
|
||||
The string is left unchanged, if it does not contain the separator.
|
||||
*/
|
||||
func dropAfterLast(_ separator: String) -> String {
|
||||
guard contains(separator) else {
|
||||
|
Reference in New Issue
Block a user