fix: content suffix for markdown respond format

This commit is contained in:
Yanlong Wang 2025-02-04 15:59:01 +08:00
parent cc6d2f3e29
commit a453ab5f16
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -410,10 +410,6 @@ export class SnapshotFormatter extends AsyncService {
Object.assign(f, formatted);
const textRepresentation = (function (this: typeof formatted) {
if (mode.includes('markdown')) {
return this.content as string;
}
const mixins = [];
if (this.publishedTime) {
mixins.push(`Published Time: ${this.publishedTime}`);
@ -450,6 +446,11 @@ export class SnapshotFormatter extends AsyncService {
mixins.push(`Warning: ${this.warning}`);
}
if (mode.includes('markdown')) {
return `${mixins.length ? `${mixins.join('\n\n')}\n\n` : ''}${this.content}
${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
}
return `Title: ${this.title}
URL Source: ${this.url}