Skip to content
New issue

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

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

Already on GitHub? # to your account

Colors codes being stripped out #62

Open
smallstepstoday opened this issue Jul 12, 2020 · 7 comments
Open

Colors codes being stripped out #62

smallstepstoday opened this issue Jul 12, 2020 · 7 comments

Comments

@smallstepstoday
Copy link

This line is stripping out the pound sign (#) before color codes in tagged template literals, like those for styled-components. For example,

const StyledKeyphraseListItem = styled.li`
  display: inline;
  padding: 0.875rem 1rem;
  background-color: #fff;

  text-align: center;
  font: 0.75rem/2.125rem 'Open Sans';
  letter-spacing: 0;
  color: #444444;
  opacity: 1;
  white-space: nowrap;

  margin-right: 0.625rem;
  margin-top: 0.625rem;
`;

turns #fff into fff, making it impossible to determine if this is a color code.

@smallstepstoday
Copy link
Author

I have a pull request with a proposed fix.

@aotaduy
Copy link
Owner

aotaduy commented Jul 15, 2020

Couldn't we add a regexp so the word is skipped ? or the thing is that is not being taken into account by the regepx before being split into # and fff ?

@smallstepstoday
Copy link
Author

The only line that is changed is the RegExp that handles removing characters before the text is evaluated... The only difference is that it now extracts only those hash symbols that do not precede a color code pattern. I think the change accomplishes the task.

@smallstepstoday
Copy link
Author

Any chance you could review and approve this change? It has been almost three months since the PR was submitted and we are still encountering this issue.

@smallstepstoday
Copy link
Author

Does not appear this plugin is being maintained. Closing

@aotaduy
Copy link
Owner

aotaduy commented Dec 1, 2022

Hi @smallstepstoday this plugin is being maintained, but in my spare time looks like i didnt check your pr on time, sorry.

@aotaduy
Copy link
Owner

aotaduy commented Dec 1, 2022

Let me check if my proposed solution is ok.
This will be to add a regexp on the configuration rather than in the code for his special case

@aotaduy aotaduy reopened this Dec 1, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants