Unverified Commit dc5d8dde authored by NGPixel's avatar NGPixel

fix: handle page metadata parse failure

parent 05b40539
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment