mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
+3
-2
@@ -163,8 +163,9 @@ class App extends Component {
|
|||||||
// check templates
|
// check templates
|
||||||
var qweb = new owl.QWeb();
|
var qweb = new owl.QWeb();
|
||||||
var error = false;
|
var error = false;
|
||||||
|
const sanitizedXML = this.state.xml.replace(/<!--[\s\S]*?-->/g, "");
|
||||||
try {
|
try {
|
||||||
qweb.loadTemplates(this.state.xml);
|
qweb.loadTemplates(sanitizedXML);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e;
|
error = e;
|
||||||
}
|
}
|
||||||
@@ -190,7 +191,7 @@ class App extends Component {
|
|||||||
owlScript.addEventListener("load", () => {
|
owlScript.addEventListener("load", () => {
|
||||||
const script = doc.createElement("script");
|
const script = doc.createElement("script");
|
||||||
script.type = "text/javascript";
|
script.type = "text/javascript";
|
||||||
const content = `window.TEMPLATES = \`${this.state.xml}\`\n${
|
const content = `window.TEMPLATES = \`${sanitizedXML}\`\n${
|
||||||
this.state.js
|
this.state.js
|
||||||
}`;
|
}`;
|
||||||
script.innerHTML = content;
|
script.innerHTML = content;
|
||||||
|
|||||||
Reference in New Issue
Block a user