|
@@ -108,6 +108,11 @@ function getDefaultOpts(simple) {
|
|
|
description: 'Enables github @mentions',
|
|
|
type: 'boolean'
|
|
|
},
|
|
|
+ ghMentionsLink: {
|
|
|
+ defaultValue: 'https://github.com/{u}',
|
|
|
+ description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
|
|
|
+ type: 'string'
|
|
|
+ },
|
|
|
encodeEmails: {
|
|
|
defaultValue: true,
|
|
|
description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
|
|
@@ -1340,7 +1345,13 @@ showdown.subParser('anchors', function (text, options, globals) {
|
|
|
if (escape === '\\') {
|
|
|
return st + mentions;
|
|
|
}
|
|
|
- return st + '<a href="https://www.github.com/' + username + '">' + mentions + '</a>';
|
|
|
+
|
|
|
+ //check if options.ghMentionsLink is a string
|
|
|
+ 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>';
|
|
|
});
|
|
|
}
|
|
|
|