summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-06-24 00:02:23 +0100
committerGitHub <noreply@github.com>2021-06-23 19:02:23 -0400
commitd13a0e621b9a87a50392450c96e7f293cb1e550c (patch)
tree72d2e0551c9c7a282a1f4b3d163cecc915d9d02c /web_src
parent5f2ef17fdb7523398f1b84d8a1cad0f24b72667e (diff)
downloadgitea-d13a0e621b9a87a50392450c96e7f293cb1e550c.tar.gz
gitea-d13a0e621b9a87a50392450c96e7f293cb1e550c.zip
Do not show No match found for tribute (#16231)
Tribute.js will show an untranslated no match found if no emoji or mentions. Further the mentions should really require a preceding space. This PR fixes both of these. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/tribute.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/features/tribute.js b/web_src/js/features/tribute.js
index 851ff74e57..6fdb2f5df0 100644
--- a/web_src/js/features/tribute.js
+++ b/web_src/js/features/tribute.js
@@ -32,7 +32,7 @@ function makeCollections({mentions, emoji}) {
if (emoji) {
collections.push({
values: window.config.tributeValues,
- noMatchTemplate: () => null,
+ requireLeadingSpace: true,
menuItemTemplate: (item) => {
return `
<div class="tribute-item">
@@ -69,7 +69,7 @@ export default async function attachTribute(elementOrNodeList, {mentions, emoji}
emoji: emoji || emojiNodes.length > 0,
});
- const tribute = new Tribute({collection: collections});
+ const tribute = new Tribute({collection: collections, noMatchTemplate: ''});
for (const node of uniqueNodes) {
tribute.attach(node);
}