mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(simpleAutoLinks): fix emails being treated as simple urls
Closes #187
This commit is contained in:
parent
ea6031a25f
commit
7dc3fb1d25
4
dist/showdown.js
vendored
4
dist/showdown.js
vendored
@ -1,4 +1,4 @@
|
|||||||
;/*! showdown 02-08-2015 */
|
;/*! showdown 11-08-2015 */
|
||||||
(function(){
|
(function(){
|
||||||
/**
|
/**
|
||||||
* Created by Tivie on 13-07-2015.
|
* Created by Tivie on 13-07-2015.
|
||||||
@ -1011,7 +1011,7 @@ showdown.subParser('autoLinks', function (text, options) {
|
|||||||
|
|
||||||
if (options.simplifiedAutoLink) {
|
if (options.simplifiedAutoLink) {
|
||||||
text = text.replace(simpleURLRegex, '<a href=\"$1\">$1</a>');
|
text = text.replace(simpleURLRegex, '<a href=\"$1\">$1</a>');
|
||||||
text = text.replace(simpleMailRegex, '<a href=\"$1\">$1</a>');
|
text = text.replace(simpleMailRegex, replaceMail);
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceMail(wholeMatch, m1) {
|
function replaceMail(wholeMatch, m1) {
|
||||||
|
2
dist/showdown.js.map
vendored
2
dist/showdown.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/showdown.min.js
vendored
4
dist/showdown.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/showdown.min.js.map
vendored
2
dist/showdown.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -15,7 +15,7 @@ showdown.subParser('autoLinks', function (text, options) {
|
|||||||
|
|
||||||
if (options.simplifiedAutoLink) {
|
if (options.simplifiedAutoLink) {
|
||||||
text = text.replace(simpleURLRegex, '<a href=\"$1\">$1</a>');
|
text = text.replace(simpleURLRegex, '<a href=\"$1\">$1</a>');
|
||||||
text = text.replace(simpleMailRegex, '<a href=\"$1\">$1</a>');
|
text = text.replace(simpleMailRegex, replaceMail);
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceMail(wholeMatch, m1) {
|
function replaceMail(wholeMatch, m1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user