A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
1export const htmlRender = (element: Element) => {
2 let htmlElements: Element[] = [];
3 if (element.getAttribute("data-type") === "NodeHTMLBlock") {
4 // 编辑器内代码块编辑渲染
5 htmlElements = [element];
6 } else {
7 htmlElements = Array.from(element.querySelectorAll('[data-type="NodeHTMLBlock"]'));
8 }
9 if (htmlElements.length === 0) {
10 return;
11 }
12 if (htmlElements.length > 0) {
13 htmlElements.forEach((e: HTMLDivElement) => {
14 e.firstElementChild.firstElementChild.setAttribute("aria-label", window.siyuan.languages.edit);
15 e.firstElementChild.lastElementChild.setAttribute("aria-label", window.siyuan.languages.more);
16 });
17 }
18};