Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.
/ marked Public archive
forked from markedjs/marked

Commit 202fa62

Browse files
committed
Add -mangle/-no-mangle to enable/disable mangling of email addresses.
To keep the "standard"/previous behaviour, mangling is on by default.
1 parent 2b5802f commit 202fa62

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/marked.js

+2
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ InlineLexer.prototype.smartypants = function(text) {
730730
*/
731731

732732
InlineLexer.prototype.mangle = function(text) {
733+
if (!this.options.mangle) return text;
733734
var out = ''
734735
, l = text.length
735736
, i = 0
@@ -1232,6 +1233,7 @@ marked.defaults = {
12321233
breaks: false,
12331234
pedantic: false,
12341235
sanitize: false,
1236+
mangle: true,
12351237
smartLists: false,
12361238
silent: false,
12371239
highlight: null,

man/marked.1

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ Use smarter list behavior than the original markdown.
6161
.BI \-\-lang\-prefix\ [\fIprefix\fP]
6262
Set the prefix for code block classes.
6363
.TP
64+
.BI \-\-mangle
65+
Mangle email addresses.
66+
.TP
6467
.BI \-\-no\-sanitize,\ \-no-etc...
6568
The inverse of any of the marked options above.
6669
.TP

0 commit comments

Comments
 (0)