External files, improve page generation

This commit is contained in:
Christoph Hagen
2024-12-10 15:21:28 +01:00
parent 8183bc4903
commit efc9234917
50 changed files with 1069 additions and 424 deletions

View File

@ -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 {