Last active
March 17, 2020 16:34
-
-
Save altherlex/8ef13b119a8c476a0796e231c59ba598 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HowToUse: | |
// {{linkWorkItem subject}} | |
module.exports = function (Handlebars) { | |
Handlebars.registerHelper('linkWorkItem', function (context) { | |
var index = context.search(/(\d{3,})\s/g) | |
if (index !== -1 && context.slice(index-1, index) !== '#') { | |
return context.slice(0, index) + '#' + context.slice(index) | |
} | |
return context | |
}) | |
Handlebars.registerHelper('envVar', function (context, options) { | |
return process.env[context] | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment