UNPKG

@muban/template

Version:

Writing templates for Muban components during development

14 lines (13 loc) 439 B
import { html } from '../mtl'; /** * Helper function to render unsafe HTML in the DOM * @param data */ export function unsafeHTML(data) { // fake calling the tagged template string function as if it was coming from // an actual usage of a template string to allow parsing HTML tags into // a "parsed" array of children without losing HTML formatting var item = [data]; item['raw'] = [data]; return html(item); }