From 8e6ed525b7986d2280233a5524f65402b9f0ca50 Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Tue, 23 Mar 2021 12:13:28 +0100 Subject: [PATCH] fix: add img regex for html news --- src/posts/posts.controller.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/posts/posts.controller.ts b/src/posts/posts.controller.ts index dcc8ebf9f..4db645243 100644 --- a/src/posts/posts.controller.ts +++ b/src/posts/posts.controller.ts @@ -56,6 +56,8 @@ export class PostsController { post.feature_image = `https://${this.configService.config.host}/blog/content${ post.feature_image.split('/content')[1] }`; + const regex = /(https?:\/\/ghost):(\d*)?/g; // (https?://ghost):(\d*)?/ + post.html = post.html.replace(regex, `${this.configService.config.host}`); } return post; }); -- GitLab