Decode percent encodings for markdown images
This commit is contained in:
parent
87d54788db
commit
6e717a8cf7
@ -87,8 +87,11 @@ struct PageContentGenerator {
|
|||||||
// For a simple boxes: ![box](title;body)
|
// For a simple boxes: ![box](title;body)
|
||||||
// A fancy page link: ![page](page_id)
|
// A fancy page link: ![page](page_id)
|
||||||
// External pages: ![external](url1, text1; url2, text2, ...)
|
// External pages: ![external](url1, text1; url2, text2, ...)
|
||||||
let fileAndTitle = markdown.between(first: "](", andLast: ")")
|
guard let fileAndTitle = markdown.between(first: "](", andLast: ")").removingPercentEncoding else {
|
||||||
let alt = markdown.between("[", and: "]").nonEmpty
|
results.warning("Invalid percent encoding for markdown image", source: page.path)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
let alt = markdown.between("[", and: "]").nonEmpty?.removingPercentEncoding
|
||||||
if let alt = alt, let command = ShorthandMarkdownKey(rawValue: alt) {
|
if let alt = alt, let command = ShorthandMarkdownKey(rawValue: alt) {
|
||||||
return handleShortHandCommand(command, page: page, language: language, content: fileAndTitle)
|
return handleShortHandCommand(command, page: page, language: language, content: fileAndTitle)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user