Add -mangle/-no-mangle to enable/disable mangling of email addresses.

To keep the "standard"/previous behaviour, mangling is on by default.
This commit is contained in:
Dmitry Chestnykh 2015-02-02 15:12:48 +01:00
parent 2b5802f258
commit 202fa62c3f
2 changed files with 5 additions and 0 deletions

View File

@ -730,6 +730,7 @@ InlineLexer.prototype.smartypants = function(text) {
*/
InlineLexer.prototype.mangle = function(text) {
if (!this.options.mangle) return text;
var out = ''
, l = text.length
, i = 0
@ -1232,6 +1233,7 @@ marked.defaults = {
breaks: false,
pedantic: false,
sanitize: false,
mangle: true,
smartLists: false,
silent: false,
highlight: null,

View File

@ -61,6 +61,9 @@ Use smarter list behavior than the original markdown.
.BI \-\-lang\-prefix\ [\fIprefix\fP]
Set the prefix for code block classes.
.TP
.BI \-\-mangle
Mangle email addresses.
.TP
.BI \-\-no\-sanitize,\ \-no-etc...
The inverse of any of the marked options above.
.TP