Преглед на файлове

fix: Wrap html templates in template literals

version-14
Faris Ansari преди 4 години
родител
ревизия
b2cddf73d7
променени са 1 файла, в които са добавени 3 реда и са изтрити 4 реда
  1. +3
    -4
      esbuild/frappe-html.js

+ 3
- 4
esbuild/frappe-html.js Целия файл

@@ -20,7 +20,7 @@ module.exports = {
.then(content => {
content = scrub_html_template(content);
return {
contents: `\n\tfrappe.templates['${filename}'] = '${content}';\n`
contents: `\n\tfrappe.templates['${filename}'] = \`${content}\`;\n`
};
})
.catch(() => {
@@ -38,7 +38,6 @@ module.exports = {
};

function scrub_html_template(content) {
content = content.replace(/\s/g, " ");
content = content.replace(/(<!--.*?-->)/g, "");
return content.replace("'", "'"); // eslint-disable-line
content = content.replace(/`/g, "\\`");
return content;
}

Зареждане…
Отказ
Запис