You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/07/27 04:25:20 UTC

[jira] [Commented] (LANG-1023) WordUtils.wrap: Customizable breakable characters (not just space/whitespace)

    [ https://issues.apache.org/jira/browse/LANG-1023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15395020#comment-15395020 ] 

ASF GitHub Bot commented on LANG-1023:
--------------------------------------

GitHub user marko-bekhta opened a pull request:

    https://github.com/apache/commons-lang/pull/179

    LANG-1023

    WordUtils.wrap: Customizable breakable characters (not just space/whitespace)
    
    changed wrap method to use regex pattern to find breakable characters rather than only spaces. added a few basic tests for "regex wrap"

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/marko-bekhta/commons-lang master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/179.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #179
    
----
commit 0fe9685c8a78ba2d780a3ec1e1a323990dc6d218
Author: marko-bekhta <ma...@prykladna.lviv.ua>
Date:   2016-07-27T04:21:32Z

    LANG-1023
    WordUtils.wrap: Customizable breakable characters (not just space/whitespace)
    
    changed wrap method to use regex pattern to find breakable characters rather than only spaces. added a few basic tests for "regex wrap"

----


> WordUtils.wrap: Customizable breakable characters (not just space/whitespace)
> -----------------------------------------------------------------------------
>
>                 Key: LANG-1023
>                 URL: https://issues.apache.org/jira/browse/LANG-1023
>             Project: Commons Lang
>          Issue Type: Wish
>          Components: lang.text.*
>    Affects Versions: 3.3.2
>            Reporter: Andrew Pennebaker
>              Labels: word,wrap,word-wrap,
>             Fix For: Patch Needed
>
>
> WordUtils.wrap is good at what it does, but I want slightly different semantics. I would like the option to set different characters for word breaking, not just space or whitespace, but punctuation marks.
> The current implementation wraps like this:
> flammable/inflammable [original string]
> flammable/inflammable [wrap with large widths]
> flammable/inflammable [wrap with wrapLongWords = false]
> flammable/inflam           [wrap with wrapLongWords = true]
> mable
> I would like to configure wrap to break "flammable/inflammable" on punctuation marks as well as whitespace, so that it wraps like this:
> flammable/                     [wrap with additionalBreakCharacters = "/+-"]
> inflammable



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)