[FIX] handling of multiline strings during qweb translation

Javascript regexps don't provide a DOTALL flag (to make `.` match
newlines) so have to replace `.` by `[\s\S]` hack, as *that* will
match newlines as well as all other characters.

Note: the `m` flag has a different meaning, it makes `^` and `$` match
      the start and end of lines rather than the start and end of the
      string itself.

bzr revid: xmo@openerp.com-20130516105908-exgtwwf785hrmedo
This commit is contained in:
Xavier Morel
2013-05-16 12:59:08 +02:00
+1 -1
View File
@@ -562,7 +562,7 @@ instance.web.qweb.preprocess_node = function() {
if (translation && translation.value === 'off') {
return;
}
var match = /^(\s*)(.+?)(\s*)$/.exec(this.node.data);
var match = /^(\s*)([\s\S]+?)(\s*)$/.exec(this.node.data);
if (match) {
this.node.data = match[1] + instance.web._t(match[2]) + match[3];
}