1 | var newElement = require("new-element");
|
2 |
|
3 | module.exports = ifNecessary;
|
4 |
|
5 | function ifNecessary (html, vars) {
|
6 | if (!isHTML(html)) return html;
|
7 | return newElement(html, vars);
|
8 | }
|
9 |
|
10 | function isHTML(text){
|
11 | return typeof text == 'string' && text.charAt(0) == '<';
|
12 | }
|