Skip to content

Instantly share code, notes, and snippets.

@altherlex
Last active March 17, 2020 16:34
Show Gist options
  • Save altherlex/8ef13b119a8c476a0796e231c59ba598 to your computer and use it in GitHub Desktop.
Save altherlex/8ef13b119a8c476a0796e231c59ba598 to your computer and use it in GitHub Desktop.
// 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