From 4370aefb0228816bbbdbcf3142d2ea31b0c51f36 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 30 May 2022 11:51:22 +0800 Subject: [PATCH] :lipstick: https://github.com/siyuan-note/siyuan/issues/5017 1 --- app/src/util/Tree.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/util/Tree.ts b/app/src/util/Tree.ts index 7e39936a9..c1ac13cf5 100644 --- a/app/src/util/Tree.ts +++ b/app/src/util/Tree.ts @@ -2,6 +2,8 @@ import {getIconByType} from "../editor/getIcon"; import {hasClosestByTag} from "../protyle/util/hasClosest"; import {isMobile} from "./functions"; import {mathRender} from "../protyle/markdown/mathRender"; +import {unicode2Emoji} from "../emoji"; +import {Constants} from "../constants"; export class Tree { public element: HTMLElement; @@ -92,11 +94,20 @@ ${item.label ? "data-label='" + item.label + "'" : ""}> data.forEach((item: IBlock & { subType: string; count: string; + ial?: { + icon: string + } }) => { let countHTML = ""; if (item.count) { countHTML = `${item.count}`; } + let iconHTML; + if (item.type === "NodeDocument") { + iconHTML = `${unicode2Emoji(item.ial.icon || Constants.SIYUAN_IMAGE_FILE)}` + } else { + iconHTML = `` + } html += `
  • - + ${iconHTML} ${item.content} ${countHTML} ${this.blockExtHTML || ""}