diff --git a/src/Channel.ts b/src/Channel.ts index 1691edd..9334199 100644 --- a/src/Channel.ts +++ b/src/Channel.ts @@ -71,7 +71,7 @@ export class Channel { const topicText = response.data["topic"]; if (!topicText || this.topic.get("text") !== "") return; - this.topic.set("text", topicText); + this.topic.set("text", topicText.replace(/\r\n|\r|\n/g, " ")); this.topic.set("timestamp", Date.now().toString(10).substring(0, 10)); this.topic.set('setter', "matrix"); }).catch(e => { diff --git a/src/Server.ts b/src/Server.ts index 0535ee1..f324b69 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -529,7 +529,7 @@ export class Server { return; const topicSetter = this.getOrCreateMatrixUser(event["sender"]); const topicTS: string = event["origin_server_ts"].toString(); - targetChannel.topic.set("text", topicText); + targetChannel.topic.set("text", topicText.replace(/\r\n|\r|\n/, " ")); targetChannel.topic.set("timestamp", topicTS.substring(0,10)) targetChannel.topic.set('setter', topicSetter.nick);