Replace <p>s with <br/>s consistently

Also, allow newlines in /commands.
Fixes vector-im/vector-web#2114, vector-im/vector-web#2165.
This commit is contained in:
Aviral Dasgupta 2016-09-16 20:32:08 +05:30
parent 2b9258d377
commit 6befb09509
3 changed files with 81 additions and 67 deletions

View file

@ -304,7 +304,7 @@ module.exports = {
// IRC-style commands
input = input.replace(/\s+$/, "");
if (input[0] === "/" && input[1] !== "/") {
var bits = input.match(/^(\S+?)( +(.*))?$/);
var bits = input.match(/^(\S+?)( +((.|\n)*))?$/);
var cmd, args;
if (bits) {
cmd = bits[1].substring(1).toLowerCase();