标题为空显示unnamed
@@ -248,7 +248,9 @@ const ArticleWidget = ({
key: key,
title: (
<Space>
- <PaliText text={strTitle} />
+ <PaliText
+ text={strTitle === "" ? "[unnamed]" : strTitle}
+ />
{progress}
</Space>
),
@@ -138,7 +138,11 @@ const TocTreeWidget = ({
titleRender={(node: TreeNodeData) => {
const currNode =
typeof node.title === "string" ? (
- <PaliText text={node.title} />
+ node.title === "" ? (
+ "[unnamed]"
+ ) : (
+ <PaliText text={node.title} />
+ )
) : (
<>{node.title}</>
);