Skip to content

Commit

Permalink
fix(githubMentions): githubMentions now works with openLinksInNewWind…
Browse files Browse the repository at this point in the history
…ow options

githubMentions links can now be opened in new windows when using the option openLinksInNewWindow

Closes #403
  • Loading branch information
tsndr authored and tivie committed Jun 22, 2017
1 parent a2259c0 commit 1194d88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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": {
Expand Down
8 changes: 6 additions & 2 deletions src/subParsers/anchors.js
Expand Up @@ -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>';
});
}

Expand Down

0 comments on commit 1194d88

Please sign in to comment.