mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user