mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader.git
synced 2025-08-20 13:39:08 +08:00
fix: content suffix for markdown respond format
This commit is contained in:
parent
cc6d2f3e29
commit
a453ab5f16
@ -410,10 +410,6 @@ export class SnapshotFormatter extends AsyncService {
|
|||||||
Object.assign(f, formatted);
|
Object.assign(f, formatted);
|
||||||
|
|
||||||
const textRepresentation = (function (this: typeof formatted) {
|
const textRepresentation = (function (this: typeof formatted) {
|
||||||
if (mode.includes('markdown')) {
|
|
||||||
return this.content as string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const mixins = [];
|
const mixins = [];
|
||||||
if (this.publishedTime) {
|
if (this.publishedTime) {
|
||||||
mixins.push(`Published Time: ${this.publishedTime}`);
|
mixins.push(`Published Time: ${this.publishedTime}`);
|
||||||
@ -450,6 +446,11 @@ export class SnapshotFormatter extends AsyncService {
|
|||||||
mixins.push(`Warning: ${this.warning}`);
|
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}
|
return `Title: ${this.title}
|
||||||
|
|
||||||
URL Source: ${this.url}
|
URL Source: ${this.url}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user