mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
902e361e22
no issue - cleans up multiple CPs that were only outputting a background image style - moves URL decoding/encoding and `htmlSafe` output into one place
13 lines
342 B
JavaScript
13 lines
342 B
JavaScript
import {helper} from '@ember/component/helper';
|
|
import {htmlSafe} from '@ember/string';
|
|
|
|
export function backgroundImageStyle([url]/*, hash*/) {
|
|
if (url) {
|
|
let safeUrl = encodeURI(decodeURI(url));
|
|
return htmlSafe(`background-image: url(${safeUrl});`);
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
export default helper(backgroundImageStyle);
|