17 lines
501 B
TypeScript
17 lines
501 B
TypeScript
|
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;
|
||
|
}
|
||
|
}
|