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

Fix for #386: Format function (%) doesn't support uppercase placeholders #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

webberig
Copy link

I have coded a solution for #386. Less.js uses encodeURIComponent() if the matched tag is uppercase, so I followed that logic and basically made 2 changes to the lib__sprintf() function:

  • Changed the regex that looks for %d, %s or %a, so that it also will match uppercase tags
  • If the match is uppercase, call urlencode() on the given $value

@Krinkle
Copy link
Collaborator

Krinkle commented Oct 15, 2018

Thanks. A unit test to confirm the functionality would be nice. Without it it might still get reviewed/merged, but might take longer.

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

Successfully merging this pull request may close these issues.

None yet

2 participants