aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-06-18 10:38:47 +0200
committerGitHub <noreply@github.com>2023-06-18 08:38:47 +0000
commitf47744c3f11953a48a30b40930887764041552a4 (patch)
tree296b10f92d334b7da659d3389fa1a874d03e29f1 /web_src/js/features
parent4e2f1ee58d1aa49f85c3a28a4f96e915f12bdb21 (diff)
downloadgitea-f47744c3f11953a48a30b40930887764041552a4.tar.gz
gitea-f47744c3f11953a48a30b40930887764041552a4.zip
Update JS dependencies, remove space after emoji completion (#25266)
- Update all JS dependencies - Enable stylint [`media-feature-name-value-no-unknown`](https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown) - Make use of new features in webpack and text-expander-element - Tested Swagger and Mermaid To explain the `text-expander-element` change: Before this version, the element added a unavoidable space after emoji completion. Now that https://github.com/github/text-expander-element/pull/36 is in, we gain control over this space and I opted to remove it for emoji completion and retain it for `@` mentions. --------- Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/comp/TextExpander.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/web_src/js/features/comp/TextExpander.js b/web_src/js/features/comp/TextExpander.js
index e2840610df..128a2ddff0 100644
--- a/web_src/js/features/comp/TextExpander.js
+++ b/web_src/js/features/comp/TextExpander.js
@@ -53,7 +53,9 @@ export function initTextExpander(expander) {
});
expander?.addEventListener('text-expander-value', ({detail}) => {
if (detail?.item) {
- detail.value = detail.item.getAttribute('data-value');
+ // add a space after @mentions as it's likely the user wants one
+ const suffix = detail.key === '@' ? ' ' : '';
+ detail.value = `${detail.item.getAttribute('data-value')}${suffix}`;
}
});
}