Compare commits
2 Commits
6e717a8cf7
...
1b6441e03e
Author | SHA1 | Date | |
---|---|---|---|
|
1b6441e03e | ||
|
5f5c250272 |
@ -431,7 +431,7 @@ extension Element {
|
|||||||
|
|
||||||
// Find the common elements of the path, which can be discarded
|
// Find the common elements of the path, which can be discarded
|
||||||
var index = 0
|
var index = 0
|
||||||
while pageParts[index] == ownParts[index] {
|
while index < pageParts.count && index < ownParts.count && pageParts[index] == ownParts[index] {
|
||||||
index += 1
|
index += 1
|
||||||
}
|
}
|
||||||
// The relative path needs to go down to the first common folder,
|
// The relative path needs to go down to the first common folder,
|
||||||
|
@ -278,7 +278,10 @@ struct PageContentGenerator {
|
|||||||
results.warning("Invalid external link definition", source: page.path)
|
results.warning("Invalid external link definition", source: page.path)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
let url = parts[0].trimmed
|
guard let url = parts[0].trimmed.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {
|
||||||
|
results.warning("Invalid external link \(parts[0].trimmed)", source: page.path)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
let title = parts[1].trimmed
|
let title = parts[1].trimmed
|
||||||
|
|
||||||
return (url, title)
|
return (url, title)
|
||||||
|
Loading…
Reference in New Issue
Block a user