[FIX] Unsupported self closing tags shall not reach FormRenderingEngine

bzr revid: fme@openerp.com-20130221172327-0dydqn548av5vkqo
This commit is contained in:
Fabien Meghazi
2013-02-21 18:23:27 +01:00
parent 620c7359e8
commit 3467d27261
+11 -2
View File
@@ -1547,13 +1547,22 @@ instance.web.json_node_to_xml = function(node, human_readable, indent) {
}
};
instance.web.xml_to_str = function(node) {
var str = "";
if (window.XMLSerializer) {
return (new XMLSerializer()).serializeToString(node);
str = (new XMLSerializer()).serializeToString(node);
} else if (window.ActiveXObject) {
return node.xml;
str = node.xml;
} else {
throw new Error(_t("Could not serialize XML"));
}
// Browsers won't deal with self closing tags except br, hr, input, ...
// http://stackoverflow.com/questions/97522/what-are-all-the-valid-self-closing-elements-in-xhtml-as-implemented-by-the-maj
//
// The following regex is a bit naive but it's ok for the xmlserializer output
str = str.replace(/<([a-z]+)([^<>]*)\s?\/\s?>/g, function(match, tag, attrs) {
return "<" + tag + attrs + "></" + tag + ">";
});
return str;
};
/**