| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1× 1× 8× | import Autolinker from 'autolinker'
import { helper } from '@ember/component/helper'
import { htmlSafe } from '@ember/string'
import Ember from 'ember'
const { Handlebars: { Utils: { escapeExpression } } } = Ember
export function autolink([text, disableHtmlSafety]) {
return htmlSafe(
Autolinker.link(disableHtmlSafety ? text : escapeExpression(text))
)
}
export default helper(autolink)
|