fix: Empty anchors no longer crash the rendering process

This commit is contained in:
NGPixel authored and Nicolas Giard committed 2017-05-01 22:04:39 -04:00
1 parent f2bcc378d5
commit a9ed499006
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -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.'
+1 -1
View File
@@ -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 {