Create mode + Source view + UI enhancements

This commit is contained in:
NGPixel
2016-08-29 22:19:47 -04:00
parent 0f06ab6dc8
commit 16f300f0d5
27 changed files with 437 additions and 84 deletions

View File

@@ -11,7 +11,6 @@ var Promise = require('bluebird'),
mdExpandTabs = require('markdown-it-expand-tabs'),
mdAttrs = require('markdown-it-attrs'),
hljs = require('highlight.js'),
slug = require('slug'),
cheerio = require('cheerio'),
_ = require('lodash');
@@ -81,10 +80,10 @@ const parseTree = (content) => {
let anchor = "";
if (heading.children && heading.children[0].type === "link_open") {
content = heading.children[1].content;
anchor = slug(content, {lower: true});
anchor = _.kebabCase(content);
} else {
content = heading.content
anchor = slug(heading.children.reduce((acc, t) => acc + t.content, ""), {lower: true});
anchor = _.kebabCase(heading.children.reduce((acc, t) => acc + t.content, ""));
}
tocArray.push({