Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toRawJson support #193

Merged
merged 2 commits into from
Oct 2, 2019
Merged

Conversation

Dean-Coakley
Copy link
Contributor

Fixes: #165

Added:

  • toRawJson
  • mustToRawJson

// The toRawJson function encodes an item into JSON string with HTML characters unescaped.

I also tried to add a toPrettyRawJson func, just by adding enc.SetIndent("", " ")
However I met an issue I was unable to resolve.

Expected '{
          "bool": true,
          "html: "<HEAD>",
          "number": 42,
          "string": "test"
        }', got '{
          "bool": true,
          "html": "<HEAD>",
          "number": 42,
          "string": "test"
        }'

Not sure if that func is of use anyway. Happy to take guidance. Or merge without.

@mattfarina mattfarina merged commit 9c496df into Masterminds:master Oct 2, 2019
@Dean-Coakley Dean-Coakley deleted the toJsonRaw-support branch October 2, 2019 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add toJson function that does not escape < and >
2 participants