• 
      

    Improve whitespace normalization to support paragraphs.

    Review Request #11025 — Created May 16, 2020 and submitted — Latest diff uploaded

    Information

    babel-plugin-django-gettext
    master

    Reviewers

    The default whitespace normalization, used for non-raw versions of the
    gettext functions, was pretty basic. It just collapsed down all
    whitespace and trimmed the resulting string.

    This works great for simple strings, but we've run into cases where we
    have paragraphs of content we want to work with, and that wasn't at all
    clean. The new support for plugins like dedent helps, but preserves
    newlines, and that's exactly what we're trying to avoid.

    This change improves the whitespace normalization to preserve
    paragraphs. Any two paragraphs must be separated by one or more blank
    lines. The whitespace normalization will be performed within each
    paragraph. The final resulting string will normalize the blank lines
    between each paragraph and trim the results.

    Unit tests passed.

    Manually tested with some code in Review Board.

    Verified the rendered information in the README.

    Commits

    Files