fix: handle page metadata parse failure
This commit is contained in:
parent
05b4053954
commit
dc5d8ddeb2
@ -192,6 +192,7 @@ module.exports = class Page extends Model {
|
||||
*/
|
||||
static parseMetadata (raw, contentType) {
|
||||
let result
|
||||
try {
|
||||
switch (contentType) {
|
||||
case 'markdown':
|
||||
result = frontmatterRegex.markdown.exec(raw)
|
||||
@ -222,6 +223,9 @@ module.exports = class Page extends Model {
|
||||
}
|
||||
break
|
||||
}
|
||||
} catch (err) {
|
||||
WIKI.logger.warn('Failed to parse page metadata. Invalid syntax.')
|
||||
}
|
||||
return {
|
||||
content: raw
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user