Skip to content

docs: Document toPrettyJson HTML character preservation#2050

Draft
promptless-for-oss wants to merge 1 commit intohelm:mainfrom
Promptless:promptless/document-toPrettyJson-html-escaping
Draft

docs: Document toPrettyJson HTML character preservation#2050
promptless-for-oss wants to merge 1 commit intohelm:mainfrom
Promptless:promptless/document-toPrettyJson-html-escaping

Conversation

@promptless-for-oss
Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Updates the toPrettyJson and mustToPrettyJson documentation to clarify that these functions preserve HTML characters (&, <, >) without escaping them to Unicode sequences like \u0026. This documents the bug fix from helm/helm#31964, which makes URLs and other strings containing these characters render correctly in JSON output.

Trigger Events

helm/helm PR #31964: fix(engine): override toPrettyJson to disable HTML escaping

Promptless Research (5 files, 1 GitHub PR)

  • Reviewed helm/helm#31964
  • Viewed .long_term_context/product_knowledge/product_overview.md
  • Viewed .long_term_context/doc_workflow/client_instructions.md
  • Viewed .long_term_context/style/client_style_guide.md
  • Viewed docs/chart_template_guide/function_list.mdx
  • Viewed versioned_docs/version-3/chart_template_guide/function_list.md

Agent Response

I've reviewed PR #31964 and created a documentation suggestion.

Summary

PR #31964 fixes a bug where toPrettyJson and mustToPrettyJson were HTML-escaping special characters (&, <, >) to Unicode sequences (\u0026, \u003c, \u003e), which broke URLs and other strings in chart templates. The fix overrides these functions to preserve the characters literally.

Documentation Update

I created a suggestion that updates the toPrettyJson documentation in:

  • docs/chart_template_guide/function_list.mdx (current docs)
  • versioned_docs/version-3/chart_template_guide/function_list.md (version 3 docs)

Changes made:

  1. Updated the summary bullet point to mention "with HTML characters unescaped"
  2. Expanded the detailed section to explain that HTML characters (&, <, >) are preserved without being escaped to Unicode sequences, making URLs render correctly

Suggestion: Document toPrettyJson HTML character preservation


Tip: Tag @Promptless in GitHub PR comments to guide documentation changes during code review 🐙

Signed-off-by: promptless-for-oss <promptless-for-oss@users.noreply.github.com>

The `toPrettyJson` function encodes an item into a pretty (indented) JSON
string.
string with HTML characters (`&`, `<`, `>`) preserved. This means URLs and
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: Based on PR #31964 which overrides toPrettyJson and mustToPrettyJson in the engine FuncMap to use json.Encoder with SetEscapeHTML(false), preserving &, <, > characters literally instead of HTML-escaping them to Unicode sequences.
View source


The `toPrettyJson` function encodes an item into a pretty (indented) JSON
string.
string with HTML characters (`&`, `<`, `>`) preserved. This means URLs and
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: Based on PR #31964 which overrides toPrettyJson and mustToPrettyJson in the engine FuncMap to use json.Encoder with SetEscapeHTML(false), preserving &, <, > characters literally instead of HTML-escaping them to Unicode sequences.
View source

@TerryHowe TerryHowe added awaiting release Feature needs to be merged and released before docs update hold Do not merge yet labels Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting release Feature needs to be merged and released before docs update hold Do not merge yet size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants