This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/helpers/icon-or-image.js.es6
2017-07-27 16:57:26 -04:00

8 lines
304 B
JavaScript

import { htmlHelper } from 'discourse-common/lib/helpers';
import { iconHTML } from 'discourse-common/lib/icon-library';
export default htmlHelper(function(str) {
if (Ember.isEmpty(str)) { return ""; }
return (str.indexOf('fa-') === 0) ? iconHTML(str.replace('fa-', '')) : `<img src='${str}'>`;
});