Skip to content

Probably Trailing new lines not supported/Line Break Issue #51

@ogawaffm

Description

@ogawaffm

I browsed the code on github and think colorize(String text, String ansiCode) will not handle trailing new lines correctly, because split will not return them. See https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)
" ... Trailing empty strings are therefore not included in the resulting array. ... "

I think the code gets in trouble with:

"a\n\n\n" because split will result in ["a"]
"a\n\n\b" because endsWithLine is set to false and therefore no new lines are added in the loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions