fix: Empty anchors no longer crash the rendering process
This commit is contained in:
parent
f2bcc378d5
commit
a9ed499006
@ -66,7 +66,7 @@
|
||||
"highlight.js": "^9.11.0",
|
||||
"i18next": "^8.1.0",
|
||||
"i18next-express-middleware": "^1.0.5",
|
||||
"i18next-node-fs-backend": "^0.1.3",
|
||||
"i18next-node-fs-backend": "^1.0.0",
|
||||
"image-size": "^0.5.1",
|
||||
"jimp": "https://github.com/ngpixel/jimp.git",
|
||||
"js-yaml": "^3.8.3",
|
||||
@ -89,7 +89,7 @@
|
||||
"moment": "^2.18.1",
|
||||
"moment-timezone": "^0.5.13",
|
||||
"mongodb": "^2.2.26",
|
||||
"mongoose": "^4.9.6",
|
||||
"mongoose": "^4.9.7",
|
||||
"multer": "^1.3.0",
|
||||
"ora": "^1.2.0",
|
||||
"passport": "^0.3.2",
|
||||
@ -103,7 +103,7 @@
|
||||
"passport-windowslive": "^1.0.2",
|
||||
"passport.socketio": "^3.7.0",
|
||||
"pm2": "^2.4.6",
|
||||
"pug": "^2.0.0-beta11",
|
||||
"pug": "^2.0.0-rc.1",
|
||||
"read-chunk": "^2.0.0",
|
||||
"remove-markdown": "^0.1.0",
|
||||
"request": "^2.81.0",
|
||||
@ -149,7 +149,7 @@
|
||||
"standard": "latest",
|
||||
"twemoji-awesome": "^1.0.6",
|
||||
"uglify-js": "latest",
|
||||
"vee-validate": "^2.0.0-beta.25",
|
||||
"vee-validate": "^2.0.0-rc.2",
|
||||
"vue": "^2.3.0"
|
||||
},
|
||||
"standard": {
|
||||
|
@ -102,7 +102,7 @@ module.exports = (port, spinner) => {
|
||||
},
|
||||
() => {
|
||||
const os = require('os')
|
||||
if (os.totalmem() < 1024 * 1024 * 768) {
|
||||
if (os.totalmem() < 1000 * 1000 * 768) {
|
||||
throw new Error('Not enough memory. Minimum is 768 MB.')
|
||||
}
|
||||
return _.round(os.totalmem() / (1024 * 1024)) + ' MB of system memory available. Minimum is 768 MB.'
|
||||
|
@ -110,7 +110,7 @@ const parseTree = (content) => {
|
||||
if (heading.type === 'inline') {
|
||||
let content = ''
|
||||
let anchor = ''
|
||||
if (heading.children && heading.children[0].type === 'link_open') {
|
||||
if (heading.children && heading.children.length > 0 && heading.children[0].type === 'link_open') {
|
||||
content = heading.children[1].content
|
||||
anchor = _.kebabCase(content)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user