From 703c0ee63e20da96960bef3ec571dde1e8243551 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Thu, 27 Apr 2023 12:31:51 +0530 Subject: [PATCH] replace https://github.com with / --- pages/wiki.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/wiki.go b/pages/wiki.go index 3fa4208..c35b564 100644 --- a/pages/wiki.go +++ b/pages/wiki.go @@ -73,7 +73,8 @@ func WikiView(c *fiber.Ctx) error { }) sc.OnHTML("div#wiki-body > div.markdown-body", func(e *colly.HTMLElement) { Content, _ := e.DOM.Html() - Scrape.PageContent = string(utils.UGCPolicy().SanitizeBytes([]byte(Content))) + Scrape.PageContent = strings.Replace(string(utils.UGCPolicy().SanitizeBytes([]byte(Content))), "https://github.com", "", -1) + }) sc.Visit("https://github.com/" + c.Params("user") + "/" + c.Params("repo") + "/wiki/" + c.Params("page")) // Add scrape-based info to wikiArray