smartntml/ts/classes.smartntml.ts

17 lines
501 B
TypeScript
Raw Normal View History

import * as plugins from './smartntml.plugins.js';
export class Smartntml {
constructor() {}
public async renderTemplateResult(
templateResult: plugins.deesElement.TemplateResult,
stripCommentsArg = true
) {
const element = document.createElement('div');
plugins.deesElement.render(templateResult, element);
let stringResult = element.innerHTML;
if (stripCommentsArg) {
stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
}
return stringResult;
}
}