summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-03-06 01:53:34 +0800
committerGitHub <noreply@github.com>2022-03-06 01:53:34 +0800
commit3e28fa72cedc559e0dc3396d0676a5d1dab12624 (patch)
treec119edc1e719608ab1aed7536a88bfbae3168a68 /web_src
parent814750e647722ecf5ed2938844744bed139fffd5 (diff)
downloadgitea-3e28fa72cedc559e0dc3396d0676a5d1dab12624.tar.gz
gitea-3e28fa72cedc559e0dc3396d0676a5d1dab12624.zip
Fix EasyMDE error when input Enter (#19004)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/comp/EasyMDE.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/features/comp/EasyMDE.js b/web_src/js/features/comp/EasyMDE.js
index af28c0b0ee..0327a1e023 100644
--- a/web_src/js/features/comp/EasyMDE.js
+++ b/web_src/js/features/comp/EasyMDE.js
@@ -74,10 +74,10 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
const inputField = easyMDE.codemirror.getInputField();
inputField.classList.add('js-quick-submit');
easyMDE.codemirror.setOption('extraKeys', {
- Enter: () => {
+ Enter: (cm) => {
const tributeContainer = document.querySelector('.tribute-container');
if (!tributeContainer || tributeContainer.style.display === 'none') {
- return window.CodeMirror.Pass;
+ cm.execCommand('newlineAndIndent');
}
},
Backspace: (cm) => {