Skip to content

Commit

Permalink
new(all): Auto import for logo, colors and website content.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigo Rodriguez committed May 22, 2024
1 parent 6942f0d commit d6578de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,8 @@ export class KBService implements IGBKBService {
if (response.headers && response.status() === 200) {
const contentType = response.headers()['content-type'];
if (contentType && contentType.includes('text/html')) {
const buffer = await page.content();
let buffer = await page.content();
buffer = buffer?.replace(/<[^>]*>/g, '');
const urlObj = new URL(url);
const urlPath = urlObj.pathname.endsWith('/') ? urlObj.pathname.slice(0, -1) : urlObj.pathname; // Remove trailing slash if present
let filename = urlPath.split('/').pop() || 'index'; // Get the filename from the URL path or set it to 'index.html' as default
Expand Down

0 comments on commit d6578de

Please sign in to comment.