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

Add possibility to set highlighter casing #9

Closed
vladshcherbin opened this issue Apr 23, 2020 · 1 comment
Closed

Add possibility to set highlighter casing #9

vladshcherbin opened this issue Apr 23, 2020 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@vladshcherbin
Copy link
Contributor

vladshcherbin commented Apr 23, 2020

👋

Hey, it's me again. I believe this is the last feature I miss.

It would be useful to be able to set casing for highlighters. This is useful when you have query in lowercase and want to set some parts of it (e.g. keywords) to uppercase.

Opening this one because currently there is color option, however highlighters can have other features later, for example order, casing, bgColor, mode (bold, dim), etc. This needs a little thinking forward to some advanced config:

highlight(query, {
  highlighters: {
    keyword: { color: 'blue', casing: 'uppercase' },
    number: { mode: 'bold, color: 'magenta' }
  }
})

Maybe something similar to example above or other syntax, but needs to be considered since it's related to my previous issues (#6, #7)

@scriptcoded
Copy link
Owner

scriptcoded commented Oct 5, 2020

Hey, thanks for the input, and sorry for leaving you hanging for such a long while!

While I understand your use case, I feel like that is outside the scope of the library. I want to keep the library as plain and straight forward as possible, and I think adding text transformations takes away from that point. We're only dealing with colors.

Background color and mode can already be specified using the options, although the current API might not being very intuitive for novice users. Perhaps that a basis for another issue.

EDIT: Just realized that's the point of #7

@scriptcoded scriptcoded added enhancement New feature or request wontfix This will not be worked on labels Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants