mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler: properly handle <t> tags in some cases
The problem was that the compiler is based on the assumption that the multi block received by the parser only occurs in some cases where the structure of the template require a multi block, and it does not work when we have random multiblock elsewhere. We could fix the issue by modifying the code generator code to support these usecases, or by simply removing these cases in the parser. Since this seems more efficient, this is the approach taken by this commit. Note that it was a good opportunity to simplify the parser.
This commit is contained in:
committed by
Mathieu Duckerts-Antoine
parent
424bc480e2
commit
d7de25e867
@@ -76,4 +76,11 @@ describe("multi blocks", () => {
|
||||
mount(text(multi([text("a"), text("b")]) as any), fixture);
|
||||
expect(fixture.innerHTML).toBe("ab");
|
||||
});
|
||||
|
||||
test("multi inside a block", async () => {
|
||||
const block = createBlock("<div><block-child-0/></div>");
|
||||
const tree = block([], [multi([text("foo"), text("bar")])]);
|
||||
mount(tree, fixture);
|
||||
expect(fixture.innerHTML).toBe("<div>foobar</div>");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user