Skip to content

Commit 48d844c

Browse files
fix: update EHTTag and TagItem interfaces to require intro and links properties
1 parent 9b8042e commit 48d844c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/interface.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export interface EHTNamespace {
4343

4444
export interface EHTTag {
4545
name: string;
46-
intro?: string;
47-
links?: string;
46+
intro: string;
47+
links: string;
4848
}
4949

5050
export interface TagItem extends EHTTag {
@@ -54,7 +54,7 @@ export interface TagItem extends EHTTag {
5454
/** 去除 emoji 和图片等的名称 */
5555
cn: string;
5656
/** 用于搜索的简介 */
57-
introSearch?: string;
57+
introSearch: string;
5858
}
5959

6060
export type TagMap = Record<string, TagItem>;

src/plugin/introduce/index.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ export class Introduce {
113113
</div>
114114
<div class="ehs-content">
115115
${
116-
tagData.intro
117-
? tagData.intro
118-
: `
119-
<div class="ehs-no-intro">
116+
tagData.intro ||
117+
`<div class="ehs-no-intro">
120118
<h3>无介绍</h3>
121119
<center><a href="${editorUrl}" target="_blank">提供介绍</a></center>
122120
</div> `

src/plugin/tag-database.ts

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ export class TagDatabase {
8787
key,
8888
name: name,
8989
cn: this.tagging.removeImagesAndEmoji(name),
90+
intro: '',
91+
links: '',
9092
introSearch: '',
9193
};
9294
if (t.intro) {

0 commit comments

Comments
 (0)