mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: support of svg in t-raw
Before this commit, t-raw a string containing `<svg>` did not display the svg element. This was because of missing namespace in vnode's data. Now, `vdom.addNS` is called to add the svg namespace when necessary.
This commit is contained in:
committed by
Géry Debongnie
parent
85318b3ae6
commit
9fd8315c53
@@ -1105,4 +1105,11 @@ describe("html to vdom", function () {
|
||||
elm = patch(vnode0, nodeList[0]).elm;
|
||||
expect(elm.outerHTML).toEqual(`<span a="1" b="2">abc<div>1</div></span>`);
|
||||
});
|
||||
|
||||
test("svg", function () {
|
||||
const nodeList = htmlToVDOM(`<svg></svg>`);
|
||||
expect(nodeList).toHaveLength(1);
|
||||
elm = patch(vnode0, nodeList[0]).elm;
|
||||
expect(elm).toBeInstanceOf(SVGSVGElement);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user