|
|
@ -192,6 +192,7 @@ module.exports = class Page extends Model {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static parseMetadata (raw, contentType) {
|
|
|
|
static parseMetadata (raw, contentType) {
|
|
|
|
let result
|
|
|
|
let result
|
|
|
|
|
|
|
|
try {
|
|
|
|
switch (contentType) {
|
|
|
|
switch (contentType) {
|
|
|
|
case 'markdown':
|
|
|
|
case 'markdown':
|
|
|
|
result = frontmatterRegex.markdown.exec(raw)
|
|
|
|
result = frontmatterRegex.markdown.exec(raw)
|
|
|
@ -222,6 +223,9 @@ module.exports = class Page extends Model {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
WIKI.logger.warn('Failed to parse page metadata. Invalid syntax.')
|
|
|
|
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
content: raw
|
|
|
|
content: raw
|
|
|
|
}
|
|
|
|
}
|
|
|
|