summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/markdown.jsx2
-rw-r--r--web/react/utils/text_formatting.jsx8
-rw-r--r--web/react/utils/utils.jsx5
3 files changed, 8 insertions, 7 deletions
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 84c63a18b..946f93078 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -94,7 +94,7 @@ class MattermostMarkdownRenderer extends marked.Renderer {
if (title) {
out += ' title="' + title + '"';
}
- out += ' onload="window.markdownImageLoaded(this)" class="markdown-inline-img"';
+ out += ' onload="window.markdownImageLoaded(this)" onerror="window.markdownImageLoaded(this)" class="markdown-inline-img"';
out += this.options.xhtml ? '/>' : '>';
return out;
}
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index ac26107cc..705d85cf6 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -135,13 +135,13 @@ function autolinkAtMentions(text, tokens) {
return alias;
}
- function replaceAtMentionWithToken(fullMatch, prefix, mention, username) {
+ function replaceAtMentionWithToken(fullMatch, mention, username) {
let usernameLower = username.toLowerCase();
if (mentionExists(usernameLower)) {
// Exact match
const alias = addToken(usernameLower, mention, '');
- return prefix + alias;
+ return alias;
}
// Not an exact match, attempt to truncate any punctuation to see if we can find a user
@@ -154,7 +154,7 @@ function autolinkAtMentions(text, tokens) {
if (mentionExists(usernameLower)) {
const extraText = originalUsername.substr(c - 1);
const alias = addToken(usernameLower, '@' + usernameLower, extraText);
- return prefix + alias;
+ return alias;
}
} else {
// If the last character is not punctuation, no point in going any further
@@ -166,7 +166,7 @@ function autolinkAtMentions(text, tokens) {
}
let output = text;
- output = output.replace(/(^|[^a-z0-9])(@([a-z0-9.\-_]*))/gi, replaceAtMentionWithToken);
+ output = output.replace(/(@([a-z0-9.\-_]*))/gi, replaceAtMentionWithToken);
return output;
}
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 8052c000c..38f91b35f 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -513,7 +513,7 @@ export function applyTheme(theme) {
changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1);
changeCss('#post-create', 'background:' + theme.centerChannelBg, 1);
changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1);
- changeCss('.post-image__column .post-image__details', 'background:' + theme.centerChannelBg, 1);
+ changeCss('.post-image__column .post-image__details, .search-help-popover .search-autocomplete__divider span', 'background:' + theme.centerChannelBg, 1);
changeCss('.sidebar--right, .dropdown-menu, .popover, .tip-overlay', 'background:' + theme.centerChannelBg, 1);
changeCss('.popover.bottom>.arrow:after', 'border-bottom-color:' + theme.centerChannelBg, 1);
changeCss('.popover.right>.arrow:after, .tip-overlay.tip-overlay--sidebar .arrow, .tip-overlay.tip-overlay--header .arrow', 'border-right-color:' + theme.centerChannelBg, 1);
@@ -541,11 +541,12 @@ export function applyTheme(theme) {
changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box, .modal .modal-content, .settings-modal .settings-table .settings-content .divider-light, .webhooks__container, .dropdown-menu, .modal .modal-header, .popover, .mentions--top .mentions-box', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.popover.bottom>.arrow', 'border-bottom-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
+ changeCss('.search-help-popover .search-autocomplete__divider span', 'color:' + changeOpacity(theme.centerChannelColor, 0.7), 1);
changeCss('.popover.right>.arrow', 'border-right-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
changeCss('.popover.left>.arrow', 'border-left-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
changeCss('.popover.top>.arrow', 'border-top-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
changeCss('.command-name, .popover .popover-title', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
- changeCss('.dropdown-menu .divider', 'background:' + theme.centerChannelColor, 1);
+ changeCss('.dropdown-menu .divider, .search-help-popover .search-autocomplete__divider:before', 'background:' + theme.centerChannelColor, 1);
changeCss('.custom-textarea', 'color:' + theme.centerChannelColor, 1);
changeCss('.post-image__column', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 2);
changeCss('.post-image__column .post-image__details', 'color:' + theme.centerChannelColor, 2);