redpanda-data / redpanda-data/connect

Use `SetEscapeHTML` when marshalling JSON everywhere

Open
#1,253 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

annoying bloblang v5
Dominant language
Go
Stars
8.8k
Forks
969
Avg merge
1d 13h
Merged PRs (30d)
64

Description

Following up on https://github.com/benthosdev/benthos/discussions/1244, as discussed on Discord, we want to set SetEscapeHTML when marshalling JSON to avoid certain characters, namely &, < and >, being escaped to \u0026, \u003c and \u003e.

For now, this impacts the following, but I could be missing others:

  • string() - Leverages Gabs here
  • format_json() - Uses the Go json lib directly, but doesn't set this flag
  • this.bytes() triggers it too, but need to dig into it to see why

Workarounds:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with internal/bloblang/query/type_helpers.go at the Gabs call linked in the issue, then inspect format_json and the path triggered by this.bytes(). Trace the other JSON marshalling sites and verify that the listed behaviors no longer emit the escaped forms \u0026, \u003c, and \u003e.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.