mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(githubMentions): githubMentions now works with openLinksInNewWindow options
githubMentions links can now be opened in new windows when using the option openLinksInNewWindow Closes #403
This commit is contained in:
parent
a2259c063b
commit
1194d8803e
|
@ -10,7 +10,7 @@ Important HOTFIX
|
||||||
|
|
||||||
|
|
||||||
<a name="1.7.0"></a>
|
<a name="1.7.0"></a>
|
||||||
# [1.7.0](https://github.com/showdownjs/showdown/compare/1.6.4...1.7.0) (2017-06-01)
|
## [1.7.0](https://github.com/showdownjs/showdown/compare/1.6.4...1.7.0) (2017-06-01)
|
||||||
|
|
||||||
(DEPRECATED)
|
(DEPRECATED)
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
"quiet-grunt": "^0.2.3",
|
"quiet-grunt": "^0.2.3",
|
||||||
"semver": "^5.0.0",
|
"semver": "^5.0.0",
|
||||||
"semver-sort": "0.0.4",
|
"semver-sort": "0.0.4",
|
||||||
"sinon": "^1.14.1",
|
"sinon": "^2.3.3",
|
||||||
"source-map-support": "^0.4.15"
|
"source-map-support": "^0.4.15"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -82,8 +82,12 @@ showdown.subParser('anchors', function (text, options, globals) {
|
||||||
if (!showdown.helper.isString(options.ghMentionsLink)) {
|
if (!showdown.helper.isString(options.ghMentionsLink)) {
|
||||||
throw new Error('ghMentionsLink option must be a string');
|
throw new Error('ghMentionsLink option must be a string');
|
||||||
}
|
}
|
||||||
var lnk = options.ghMentionsLink.replace(/\{u}/g, username);
|
var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
|
||||||
return st + '<a href="' + lnk + '">' + mentions + '</a>';
|
target = '';
|
||||||
|
if (options.openLinksInNewWindow) {
|
||||||
|
target = ' target="¨E95Eblank"';
|
||||||
|
}
|
||||||
|
return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user