Skip to content

Commit 862066e

Browse files
committed
fix: add htmlContent field to ArticleData and PostInfo
- Introduced htmlContent field in ArticleData interface in extension.ts. - Updated PostInfo.vue to handle htmlContent in prePost function and form data.
1 parent 0e87685 commit 862066e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/components/CodemirrorEditor/EditorHeader/PostInfo.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const form = ref<ArticleData>({
2828
images: [],
2929
videos: [],
3030
fileDatas: [],
31+
htmlContent: ``,
3132
originContent: ``,
3233
markdownContent: ``,
3334
markdownOriginContent: ``,
@@ -47,6 +48,7 @@ async function prePost() {
4748
},
4849
title: ``,
4950
content: ``,
51+
htmlContent: ``,
5052
digest: ``,
5153
images: [],
5254
videos: [],
@@ -70,6 +72,7 @@ async function prePost() {
7072
.textContent ?? ``,
7173
digest: document.querySelector(`#output p`)!.textContent ?? ``,
7274
content: output.value,
75+
htmlContent: output.value,
7376
originContent: output.value,
7477
markdownContent: editor.value?.getValue() ?? ``,
7578
markdownOriginContent: editor.value?.getValue() ?? ``,

src/utils/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export interface FileData {
112112
export interface ArticleData {
113113
title: string
114114
content: string
115+
htmlContent: string
115116
digest: string
116117
cover: FileData
117118
images: FileData[]

0 commit comments

Comments
 (0)