From 023b9d401b859ba03d57e836c556f407e4d1fd23 Mon Sep 17 00:00:00 2001 From: Luigi Date: Sat, 28 Oct 2023 20:41:00 +0200 Subject: [PATCH] fix: parse nbsp unicode --- fly.toml | 3 --- internal/parser/parser.go | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fly.toml b/fly.toml index 5e5742b..e1f8102 100644 --- a/fly.toml +++ b/fly.toml @@ -3,9 +3,6 @@ kill_signal = "SIGINT" kill_timeout = 1 processes = [] -[build] - secrets = ["UNCONDITIONAL_API_SOURCE_CLIENT_KEY"] - [build.args] UNCONDITIONAL_API_ADDRESS="0.0.0.0" UNCONDITIONAL_API_PORT="8080" diff --git a/internal/parser/parser.go b/internal/parser/parser.go index c034bc0..7a14b2c 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -54,6 +54,11 @@ func removeSpecialCharacters(content string) string { // function to remove html tags from the content using regex func removeHTML(content string) string { + // No-Break Space (NBSP) + re := regexp.MustCompile(`\x{00A0}`) + + content = re.ReplaceAllString(content, " ") + return bluemonday.StrictPolicy().Sanitize(content) }