Remove markymark links from h4s.

This commit is contained in:
John-David Dalton
2016-07-02 13:41:28 -07:00
parent a8d3689061
commit 107994859b

View File

@@ -11,12 +11,21 @@ var basePath = path.join(__dirname, '..', '..'),
readmePath = path.join(docPath, 'README.md');
function build(type) {
var html = marky(fs.readFileSync(readmePath, 'utf8'), { 'sanitize': false }),
header = html('h1').first(),
version = _.trim(header.find('span').first().text());
var $ = marky(fs.readFileSync(readmePath, 'utf8'), { 'sanitize': false }),
$header = $('h1').first().remove(),
version = _.trim($header.find('span').first().text());
header.remove();
html = html.html().replace(/(<)!--\s*|\s*--(>)/g, '$1$2');
$('h4').each(function() {
$(this)
.attr('class', null)
.attr('id', null)
.find('a').each(function() {
var $this = $(this);
$this.replaceWith($this.text());
});
});
var html = $.html().replace(/(<)!--\s*|\s*--(>)/g, '$1$2');
html = [
'---',