mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] tools: allow to pre-compile templates with - in their name
Compiling a template with a dash ("-") in its name generates an
invalid function name in the compiled code.
A template named `"my-component"` leads to the function
`function my-component(app, bdom, helpers) { ... }` which has an
invalid name.
closes #1333
This commit is contained in:
committed by
Sam Degueldre
parent
b2685b6709
commit
8702db03fb
@@ -48,7 +48,7 @@ function writeToFile(filepath, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// adapted from https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
|
// adapted from https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
|
||||||
const a = "·_,:;";
|
const a = "·-_,:;";
|
||||||
const p = new RegExp(a.split("").join("|"), "g");
|
const p = new RegExp(a.split("").join("|"), "g");
|
||||||
|
|
||||||
function slugify(str) {
|
function slugify(str) {
|
||||||
|
|||||||
Reference in New Issue
Block a user