From cb4680d7ed9d438509f113d2e644bf14518860ec Mon Sep 17 00:00:00 2001
From: Supratik Das <30755453+supra08@users.noreply.github.com>
Date: Thu, 16 May 2019 19:24:05 +0530
Subject: [PATCH] [FIX] Channel settings form to textarea for Topic and
Description (#13328)
* fix: make room description and topic text area
* cleanup: remove comments
* fix review
---
.../client/stylesheets/channel-settings.css | 2 +-
app/channel-settings/client/views/channelSettings.html | 4 ++--
app/ui/client/components/header/headerRoom.js | 10 +++-------
3 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/app/channel-settings/client/stylesheets/channel-settings.css b/app/channel-settings/client/stylesheets/channel-settings.css
index dcf8e63bf85c..396bf68ed351 100644
--- a/app/channel-settings/client/stylesheets/channel-settings.css
+++ b/app/channel-settings/client/stylesheets/channel-settings.css
@@ -1,4 +1,4 @@
-html.rtl .flex-tab {
+.rtl .flex-tab {
direction: rtl;
& .channel-settings {
diff --git a/app/channel-settings/client/views/channelSettings.html b/app/channel-settings/client/views/channelSettings.html
index c7c50ecff63a..7e736cbeee8c 100644
--- a/app/channel-settings/client/views/channelSettings.html
+++ b/app/channel-settings/client/views/channelSettings.html
@@ -28,7 +28,7 @@
@@ -54,7 +54,7 @@
diff --git a/app/ui/client/components/header/headerRoom.js b/app/ui/client/components/header/headerRoom.js
index 887dc0f2ed5a..ce6f0ef4d685 100644
--- a/app/ui/client/components/header/headerRoom.js
+++ b/app/ui/client/components/header/headerRoom.js
@@ -79,19 +79,15 @@ Template.headerRoom.helpers({
const roomData = Session.get(`roomData${ this._id }`);
if (!roomData || !roomData.topic) { return ''; }
- let roomTopic = Markdown.parse(roomData.topic);
+ let roomTopic = Markdown.parse(roomData.topic.replace(/\n/mg, ' '));
// ' to apostrophe (') for emojis such as :')
roomTopic = roomTopic.replace(/'/g, '\'');
- Object.keys(emoji.packages).forEach((emojiPackage) => {
- roomTopic = emoji.packages[emojiPackage].render(roomTopic);
- });
+ roomTopic = Object.keys(emoji.packages).reduce((topic, emojiPackage) => emoji.packages[emojiPackage].render(topic), roomTopic);
// apostrophe (') back to '
- roomTopic = roomTopic.replace(/\'/g, ''');
-
- return roomTopic;
+ return roomTopic.replace(/\'/g, ''');
},
roomIcon() {