Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dblock/actionmailer-text
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Kit/actionmailer-text
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 2 files changed
  • 2 contributors

Commits on May 13, 2026

  1. Fix Regexp::TimeoutError in custom_word_wrap from backtracking regex

    The pattern /(.{1,N})(\s+|$)/ runs in quadratic time on long
    no-whitespace lines, tripping Ruby 3.2's Regexp.timeout. In
    production this surfaces when HTML emails contain long URLs,
    encoded tracking links, or wide table cells flattened to a
    single line.
    
    Replace the gsub with a linear loop that scans a window of
    line_length+1 chars for the rightmost whitespace and falls
    back to a hard break when none exists. Behavior matches the
    original on normal inputs (the existing 'wraps lines' spec
    still passes) and stays linear on pathological inputs.
    
    Fixes the production crashes tracked at
    https://kit-qq.sentry.io/issues/KIT-RAILS-WV
    scanferla committed May 13, 2026
    Configuration menu
    Copy the full SHA
    7c51c59 View commit details
    Browse the repository at this point in the history
  2. Preserve long tokens instead of hard-breaking when no whitespace fits

    The previous version split any line longer than line_length on a
    strict char boundary when no whitespace was found within the window.
    That regressed the gsub original behavior, which left long no-whitespace
    runs alone (the regex simply didn't match), so URLs and other long
    tokens stayed on a single line and remained clickable in plain text
    clients that rely on whole-line URL auto-detection.
    
    Now the else branch scans forward to the next whitespace and breaks
    there, falling back to leaving the line intact if no whitespace exists
    at all. Linear time is preserved.
    
    Spec coverage updated: pathological no-whitespace input now asserts
    the token is returned intact, and a new case covers a long URL
    surrounded by short words.
    scanferla committed May 13, 2026
    Configuration menu
    Copy the full SHA
    867e276 View commit details
    Browse the repository at this point in the history
  3. Restore outer .strip to preserve original custom_word_wrap contract

    The old gsub ended with .strip, dropping any leading or trailing
    whitespace from the wrapped result. The new implementation was
    omitting it, which only showed up under direct callers of
    custom_word_wrap (convert_to_text scrubs whitespace later, so
    end-to-end behavior was unchanged). Adding it back keeps the
    public contract identical to pre-refactor.
    scanferla committed May 13, 2026
    Configuration menu
    Copy the full SHA
    30c79b3 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2026

  1. Merge pull request #1 from Kit/ECO-5370

    ECO-5370: Fix Regexp::TimeoutError in custom_word_wrap
    scanferla authored May 14, 2026
    Configuration menu
    Copy the full SHA
    0d5292c View commit details
    Browse the repository at this point in the history
Loading