Skip to content

fix: escape quotes in Dumper dump_html and document all options#392

Draft
toddr-bot wants to merge 1 commit intoabw:masterfrom
toddr-bot:koan.toddr.bot/fix-dumper-html-escaping
Draft

fix: escape quotes in Dumper dump_html and document all options#392
toddr-bot wants to merge 1 commit intoabw:masterfrom
toddr-bot:koan.toddr.bot/fix-dumper-html-escaping

Conversation

@toddr-bot
Copy link
Copy Markdown
Contributor

@toddr-bot toddr-bot commented Apr 12, 2026

What

Adds quote escaping to dump_html() and documents all 13 supported Data::Dumper options in the POD.

Why

  • dump_html() escaped &, <, > but not " or ' — inconsistent with the project's own html_filter which escapes all five. While Dumper output is typically used in text contexts, proper escaping prevents issues in attribute contexts.
  • The POD only listed 3 of 13 supported options (Pad, Indent, Varname), making the other 10 undiscoverable. Fixes GH Document Dumper methods available for use #195.

How

  • Added s/"/&quot;/g and s/'/&#39;/g to dump_html(), matching html_filter's escaping.
  • Updated POD to list all options from @DUMPER_ARGS.
  • Updated test expectation to match the new quote escaping.

Testing

t/dumper.t passes (17/17). Test 4 assertion updated for escaped quotes in dump_html output.

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 11 insertions(+), 4 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

…bw#195)

dump_html() was missing quote escaping — single and double quotes were
passed through unescaped, inconsistent with the html_filter which
escapes both (" → &quot;, ' → &abw#39;). This could cause issues when
dump output appears in HTML attribute contexts.

Also updates the POD to document all 13 supported Data::Dumper options
(was only listing Pad, Indent, Varname). Closes GH abw#195.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

1 participant