diff --git a/index.js b/index.js index 057bfdc..b3b2078 100644 --- a/index.js +++ b/index.js @@ -46,8 +46,8 @@ Handlebars.registerHelper('icon', (name, fallback) => }), ) -Handlebars.registerHelper('join', (arr, separator) => - arr.join(typeof separator === 'string' ? separator : ', '), +Handlebars.registerHelper('join', arr => + Intl.ListFormat ? new Intl.ListFormat('en').format(arr) : arr.join(', '), ) Handlebars.registerHelper('markdown', doc => micromark(doc)) diff --git a/tap-snapshots/test/render.js.test.cjs b/tap-snapshots/test/render.js.test.cjs index 88a5ce6..1243cb0 100644 --- a/tap-snapshots/test/render.js.test.cjs +++ b/tap-snapshots/test/render.js.test.cjs @@ -386,7 +386,7 @@ blockquote > * + * { - Team lead, Designer + Team lead and Designer at Smoogle