mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🎨 禁止数据库页签标题回车和软换行
This commit is contained in:
parent
e8be82b2d7
commit
3979a72d16
2 changed files with 15 additions and 5 deletions
|
|
@ -233,6 +233,10 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
|
|||
editableElement.querySelectorAll(".img--select").forEach(item => {
|
||||
item.classList.remove("img--select");
|
||||
});
|
||||
// 数据库
|
||||
if (blockElement.getAttribute("data-type") === "NodeAttributeView") {
|
||||
return true;
|
||||
}
|
||||
// 代码块
|
||||
const trimStartText = editableElement.innerHTML.trimStart();
|
||||
if (trimStartText.startsWith("```") || trimStartText.startsWith("···") || trimStartText.startsWith("~~~") ||
|
||||
|
|
|
|||
|
|
@ -935,11 +935,17 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
}
|
||||
|
||||
// 回车
|
||||
if (!event.altKey && !event.shiftKey && isNotCtrl(event) && event.key === "Enter") {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
enter(nodeElement, range, protyle);
|
||||
return;
|
||||
if (!event.altKey && isNotCtrl(event) && event.key === "Enter") {
|
||||
if (!event.shiftKey) {
|
||||
enter(nodeElement, range, protyle);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
} else if (nodeElement.getAttribute("data-type") === "NodeAttributeView") {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchHotKey("⌘A", event)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue