mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler: call translate function with correct string
Before this commit, the parser would remove all consecutive white spaces for text nodes. After that, the code generator would call the translate function with the resulting string, which then is different than what we would expect. With this commit, we make sure we apply the translation before removing the additional whitespace. To do that, we have to move the code processing the string from the parser into the code generator, which actually makes sense, as the parser should only collect all useful information without applying too much logic. closes #1351
This commit is contained in:
committed by
Sam Degueldre
parent
cdad48d3a6
commit
7ac81ed5fe
@@ -26,10 +26,10 @@ describe("qweb parser", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("white spaces are condensed into a single space", async () => {
|
||||
test("white spaces are maintained", async () => {
|
||||
expect(parse(" ")).toEqual({
|
||||
type: ASTType.Text,
|
||||
value: " ",
|
||||
value: " ",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user