Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use headerIds to remove header IDs #144

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions lib/template/processors/md.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,15 @@ var marked = require("marked").setOptions({
headerPrefix: '',
gfm: true,
tables: true,
headerIds: false,
})
var renderer = new marked.Renderer()

// This overrides Marked’s default headings with IDs,
// since this changed after v0.2.9
// https://github.com/sintaxi/harp/issues/328
renderer.heading = function(text, level){
return '<h' + level + '>' + text + '</h' + level + '>'
}

module.exports = function(fileContents, options){

return {
compile: function(){
return function (locals){
return marked(fileContents.toString().replace(/^\uFEFF/, ''), {
renderer: renderer
})
return marked(fileContents.toString().replace(/^\uFEFF/, ''))
}
},

Expand Down