mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
a0b5d5bb1f
commit
6599b2d89b
1 changed files with 5 additions and 0 deletions
|
|
@ -1791,6 +1791,11 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
const snippetClassName = (range.commonAncestorContainer as HTMLElement).className;
|
||||
if (snippetClassName.startsWith("language-")) {
|
||||
language = snippetClassName.replace("language-", "");
|
||||
// https://github.com/siyuan-note/siyuan/issues/14767
|
||||
if (!wbrElement.parentElement.isSameNode(range.commonAncestorContainer)) {
|
||||
wbrElement.parentElement.after(wbrElement);
|
||||
wbrElement.previousElementSibling.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!window.hljs.getLanguage(language)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue