@muban/template
Version:
Writing templates for Muban components during development
18 lines (17 loc) • 582 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.unsafeHTML = void 0;
var mtl_1 = require("../mtl");
/**
* Helper function to render unsafe HTML in the DOM
* @param data
*/
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 (0, mtl_1.html)(item);
}
exports.unsafeHTML = unsafeHTML;