Add InputNormalizer.plain_text and normalize_whitespace - #30
Merged
Conversation
The placeholder example called sanitize rather than the new method, so it was failing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JaPDxxSr3thh2CstJtaE1z
The old name advertised one of three ways it differs from sanitize. It also decodes every entity and leaves angle brackets literal, which "plain text" covers in one word. Nothing calls it yet - it isn't in the v0.6.0 tag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JaPDxxSr3thh2CstJtaE1z
bug_report.rb in bike_index calls it directly from body_significant_tags?, so concealing it would leave a second copy of the same one-liner there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JaPDxxSr3thh2CstJtaE1z
sethherr
marked this pull request as ready for review
August 12, 2026 17:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two
Binxtils::InputNormalizermethods for HTML bodies where the line structure is part of the content (an email body, a pasted bug report) —sanitizeflattens those onto a single line.plain_text(value = nil)— strips the tags, unescapes the entities withCGI.unescapeHTML, then normalizes the whitespace. It's plain text rather than escaped HTML, so it differs fromsanitizeon more than whitespace: every entity is decoded and angle brackets stay literal. Kept as its own method rather than asanitizekeyword, so no call site has to read a flag to know which of the two it's getting back.normalize_whitespace(value = nil)— becomes a space (so an HTML email's "blank" lines actually strip), each line is stripped, and runs of blank lines collapse to one. Public rather than concealed, sincebug_report.rbcalls it directly frombody_significant_tags?.