From ab84e8c6055b020f29134b93c86a9ae2ce955706 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 2 Nov 2013 18:26:20 -0500 Subject: [PATCH] add headerPrefix option. fixes #272. misc readme fixes. --- README.md | 9 ++++++++- lib/marked.js | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff295de7f0..0e42c31c2c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Minimal usage: ```js console.log(marked('I am using __markdown__.')); -// Outputs:

I am using markdown.

+// Outputs:

I am using markdown.

``` Example using all options: @@ -170,6 +170,13 @@ Default: `lang-` Set the prefix for code block classes. +### headerPrefix + +Type: `String` +Default: `` + +Set the prefix for header IDs. + ## Access to lexer and parser You also have direct access to the lexer and parser if you so desire. diff --git a/lib/marked.js b/lib/marked.js index 7a07c8ae1a..aa6deb21a6 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -846,6 +846,7 @@ Parser.prototype.tok = function() { return '' + this.inline.output(this.token.text) @@ -1134,7 +1135,8 @@ marked.defaults = { silent: false, highlight: null, langPrefix: 'lang-', - smartypants: false + smartypants: false, + headerPrefix: '' }; /**