Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substring coloring #2

Open
apohllo opened this issue Feb 12, 2010 · 1 comment
Open

Substring coloring #2

apohllo opened this issue Feb 12, 2010 · 1 comment

Comments

@apohllo
Copy link

apohllo commented Feb 12, 2010

Your gem is really good, as it doesn't force users to extend String class. I had a similar solution which was bad in this respect (see apohllo/colors). But it has a feature, which is missing in your gem - I can color a substring within larger string, eg. "quick brown fox".red("fox"). It would be great if this feature were implemented.

I am going to fork your project, to play with that idea.

@nanodeath
Copy link

Similar to this, I found I can't color substrings at all.

puts red { "1" + bold { "2" } + "3" }

Expected: red "1", red+bold "2", red "3"
Actual: red "1", red+bold "2", non-bold+non-red "3" (unformatted).

Even if we don't get the solution that apohllo suggested, I think some substring formatting would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants