Skip to content

Commit

Permalink
fix(kb.gbapp): Full HTTPS address in images.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Apr 28, 2021
1 parent da8ee93 commit 53a5d8d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,17 +708,18 @@ export class KBService implements IGBKBService {

text = text.replace('! [', '![').replace('] (', '](');

let html = text.replace(`[[embed url=`, process.env.BOT_URL + '/').replace(']]', ''); // TODO: Improve it.
text = text.replace(`[[embed url=`, process.env.BOT_URL + '/').replace(']]', ''); // TODO: Improve it.
text = text.replace(`](kb`, "]("+ process.env.BOT_URL + '/kb'); // TODO: Improve it.

// According to the channel, formats the output optimized to it.

if (channel === 'webchat' && GBConfigService.get('DISABLE_WEB') !== 'true') {
html = marked(text);
const html = marked(text);
await this.sendMarkdownToWeb(min, step, conversationalService, html, answer);
} else if (channel === 'whatsapp') {
await conversationalService.sendMarkdownToMobile(min, step, user.userSystemId, text);
} else {
html = marked(text);
const html = marked(text);
await min.conversationalService.sendText(min, step, html);
}
}
Expand Down

0 comments on commit 53a5d8d

Please sign in to comment.