Skip to content

Commit

Permalink
fix: parse nbsp unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
luigibarbato committed Oct 28, 2023
1 parent 1f727bb commit 023b9d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 023b9d4

Please sign in to comment.