[go: nahoru, domu]

Skip to content

Commit

Permalink
fix header renderer.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Dec 4, 2013
1 parent 7eed150 commit 2a0b794
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,12 +792,12 @@ Renderer.prototype.blockhtml = function(html) {
return html;
};

Renderer.prototype.header = function(text, level) {
Renderer.prototype.header = function(text, level, prefix, raw) {
return '<h'
+ level
+ ' id="'
+ this.options.headerPrefix
+ text.toLowerCase().replace(/[^\w]+/g, '-')
+ prefix
+ raw.toLowerCase().replace(/[^\w]+/g, '-')
+ '">'
+ text
+ '</h'
Expand Down Expand Up @@ -932,7 +932,9 @@ Parser.prototype.tok = function() {
case 'heading': {
return renderer.header(
this.inline.output(this.token.text),
this.token.depth
this.token.depth,
this.options.headerPrefix,
this.token.text
);
}
case 'code': {
Expand Down

0 comments on commit 2a0b794

Please sign in to comment.