[IMP] mail: keep multiple spaces in chatter and chat
In chat window, a chatter and discuss, the text zone appear as a pure text zone but is transformed later on in HTML to add mentions links and possibly other features. Thus, when we wrote multiple spaces or a space at the next to html tag, with how html worked they were collpased into one (or zero). To keep them, we need to wrap the content with `<pre />` tag or replace spaces with ` `. closes #14593 opw-695535
This commit is contained in:
@@ -474,6 +474,8 @@ var BasicComposer = Widget.extend({
|
||||
// Return a deferred as this function is extended with asynchronous
|
||||
// behavior for the chatter composer
|
||||
var value = _.escape(this.$input.val()).replace(/\n|\r/g, '<br/>');
|
||||
// prevent html space collapsing
|
||||
value = value.replace(/ /g, ' ').replace(/([^>]) ([^<])/g, '$1 $2');
|
||||
var commands = this.options.commands_enabled ? this.mention_manager.get_listener_selection('/') : [];
|
||||
return $.when({
|
||||
content: this.mention_manager.generate_links(value),
|
||||
|
||||
Reference in New Issue
Block a user