diff --git a/index.js b/index.js index b565ac7..057bfdc 100644 --- a/index.js +++ b/index.js @@ -39,8 +39,11 @@ Handlebars.registerHelper('formatURL', url => url.replace(/^(https?:|)\/\//, '').replace(/\/$/, ''), ) -Handlebars.registerHelper('icon', name => - icons[name].toSvg({ width: 16, height: 16 }), +Handlebars.registerHelper('icon', (name, fallback) => + (icons[name.toLowerCase()] || icons[fallback.toLowerCase()]).toSvg({ + width: 16, + height: 16, + }), ) Handlebars.registerHelper('join', (arr, separator) => diff --git a/partials/header.hbs b/partials/header.hbs index 08178d3..0b367a6 100644 --- a/partials/header.hbs +++ b/partials/header.hbs @@ -36,7 +36,7 @@ {{/url}} {{#profiles}}
  • - {{{icon 'user'}}} + {{{icon network 'user'}}} {{#if username}} {{#if url}} {{username}} diff --git a/tap-snapshots/test-render.js-TAP.test.js b/tap-snapshots/test-render.js-TAP.test.js index aac03a0..dd1ffca 100644 --- a/tap-snapshots/test-render.js-TAP.test.js +++ b/tap-snapshots/test-render.js-TAP.test.js @@ -262,7 +262,7 @@ blockquote > * + * { richardhendricks.example.com
  • - + neutralthoughts (Twitter)