This commit is contained in:
parent
67f5614457
commit
2c29a52e5f
1 changed files with 4 additions and 0 deletions
|
@ -1554,6 +1554,10 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
const tabSpace = window.siyuan.config.editor.codeTabSpaces === 0 ? "\t" : "".padStart(window.siyuan.config.editor.codeTabSpaces, " ");
|
||||
if (nodeElement.getAttribute("data-type") === "NodeCodeBlock" && selectText !== "") {
|
||||
const wbrElement = document.createElement("wbr");
|
||||
// https://github.com/siyuan-note/siyuan/issues/8911
|
||||
if (range.startContainer.nodeType !== 3 && (range.startContainer as Element).classList.contains("protyle-action")) {
|
||||
range.setStart(nodeElement.querySelector(".hljs").firstChild, 0);
|
||||
}
|
||||
range.insertNode(wbrElement);
|
||||
range.setStartAfter(wbrElement);
|
||||
const oldHTML = nodeElement.outerHTML;
|
||||
|
|
Loading…
Add table
Reference in a new issue