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>
|
||||
# [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)
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"quiet-grunt": "^0.2.3",
|
||||
"semver": "^5.0.0",
|
||||
"semver-sort": "0.0.4",
|
||||
"sinon": "^1.14.1",
|
||||
"sinon": "^2.3.3",
|
||||
"source-map-support": "^0.4.15"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -82,8 +82,12 @@ showdown.subParser('anchors', function (text, options, globals) {
|
|||
if (!showdown.helper.isString(options.ghMentionsLink)) {
|
||||
throw new Error('ghMentionsLink option must be a string');
|
||||
}
|
||||
var lnk = options.ghMentionsLink.replace(/\{u}/g, username);
|
||||
return st + '<a href="' + lnk + '">' + mentions + '</a>';
|
||||
var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
|
||||
target = '';
|
||||
if (options.openLinksInNewWindow) {
|
||||
target = ' target="¨E95Eblank"';
|
||||
}
|
||||
return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user