nomagick commited on
Commit
a453ab5
·
unverified ·
1 Parent(s): cc6d2f3

fix: content suffix for markdown respond format

Browse files
backend/functions/src/services/snapshot-formatter.ts CHANGED
@@ -410,10 +410,6 @@ export class SnapshotFormatter extends AsyncService {
410
  Object.assign(f, formatted);
411
 
412
  const textRepresentation = (function (this: typeof formatted) {
413
- if (mode.includes('markdown')) {
414
- return this.content as string;
415
- }
416
-
417
  const mixins = [];
418
  if (this.publishedTime) {
419
  mixins.push(`Published Time: ${this.publishedTime}`);
@@ -450,6 +446,11 @@ export class SnapshotFormatter extends AsyncService {
450
  mixins.push(`Warning: ${this.warning}`);
451
  }
452
 
 
 
 
 
 
453
  return `Title: ${this.title}
454
 
455
  URL Source: ${this.url}
 
410
  Object.assign(f, formatted);
411
 
412
  const textRepresentation = (function (this: typeof formatted) {
 
 
 
 
413
  const mixins = [];
414
  if (this.publishedTime) {
415
  mixins.push(`Published Time: ${this.publishedTime}`);
 
446
  mixins.push(`Warning: ${this.warning}`);
447
  }
448
 
449
+ if (mode.includes('markdown')) {
450
+ return `${mixins.length ? `${mixins.join('\n\n')}\n\n` : ''}${this.content}
451
+ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`;
452
+ }
453
+
454
  return `Title: ${this.title}
455
 
456
  URL Source: ${this.url}