mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler: allow t-out on component tag
Before this commit, the template parser would allow using t-esc on a component tag (<MyComponent t-esc="expr"/>) but would incorrectly ignore the component when parsing a t-out: <MyComponent t-out="expr"/> would be parsed as <t t-out="expr"/> This commit solves the issue, and also, moves the `t-out` parsing code next to `t-esc` so they have the same priority relatively to other directives. closes #1483
This commit is contained in:
committed by
Sam Degueldre
parent
0d9d21a5c1
commit
2e07799250
@@ -1569,6 +1569,12 @@ describe("qweb parser", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("component with t-out", async () => {
|
||||
expect(parse(`<MyComponent t-out="someValue"/>`)).toEqual(
|
||||
parse(`<MyComponent><t t-out="someValue"/></MyComponent>`)
|
||||
);
|
||||
});
|
||||
|
||||
test("component with t-esc and content", async () => {
|
||||
expect(() => parse(`<MyComponent t-esc="someValue">Some content</MyComponent>`)).toThrow(
|
||||
"Cannot have t-esc on a component that already has content"
|
||||
|
||||
Reference in New Issue
Block a user