summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/react/components/user_settings/user_settings_modal.jsx13
-rw-r--r--web/react/utils/markdown.jsx4
-rw-r--r--web/sass-files/sass/partials/_markdown.scss7
3 files changed, 20 insertions, 4 deletions
diff --git a/web/react/components/user_settings/user_settings_modal.jsx b/web/react/components/user_settings/user_settings_modal.jsx
index 90f28822b..a7541073e 100644
--- a/web/react/components/user_settings/user_settings_modal.jsx
+++ b/web/react/components/user_settings/user_settings_modal.jsx
@@ -113,6 +113,7 @@ class UserSettingsModal extends React.Component {
return false;
}
+ this.resetTheme();
this.deactivateTab();
this.props.onModalDismissed();
}
@@ -215,15 +216,19 @@ class UserSettingsModal extends React.Component {
this.showConfirmModal(() => this.updateSection(section, true));
} else {
if (this.state.active_section === 'theme' && section !== 'theme') {
- const user = UserStore.getCurrentUser();
- if (user.theme_props != null) {
- Utils.applyTheme(user.theme_props);
- }
+ this.resetTheme();
}
this.setState({active_section: section});
}
}
+ resetTheme() {
+ const user = UserStore.getCurrentUser();
+ if (user.theme_props != null) {
+ Utils.applyTheme(user.theme_props);
+ }
+ }
+
render() {
const {formatMessage} = this.props.intl;
var tabs = [];
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 47b3a9a66..8b3602a89 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -151,6 +151,10 @@ class MattermostMarkdownRenderer extends marked.Renderer {
);
}
+ codespan(text) {
+ return '<pre class="text-nowrap">' + super.codespan(text) + '</pre>';
+ }
+
br() {
if (this.formattingOptions.singleline) {
return ' ';
diff --git a/web/sass-files/sass/partials/_markdown.scss b/web/sass-files/sass/partials/_markdown.scss
index 0ba1929e0..a08379ae1 100644
--- a/web/sass-files/sass/partials/_markdown.scss
+++ b/web/sass-files/sass/partials/_markdown.scss
@@ -54,6 +54,13 @@
code {
white-space: pre;
}
+ pre {
+ &.text-nowrap {
+ code {
+ white-space: nowrap;
+ }
+ }
+ }
}
.markdown__table {
background: #fff;