less.js
less.js copied to clipboard
fix: file path is not an absolute path when startswith "#"
What:
I don't know why this function thinks that the path starting with '#' an absolute path, but according to the definition of absolute path, this is wrong, and the path name starting with '#' return false in the built-in functions in many languages
Why:
Same as nodejs built-in implementation require('path').isAbsolute(). The file path starting with '#' is not an absolute path.
How:
Modify the regular expression to remove the match at the starting of '#'
Checklist:
- [ ] Documentation
- [ ] Added/updated unit tests
- [x] Code complete
Is there a real-world use case where this has caused a problem? In Less, this function determines if the URL should be re-written, which a URL starting with # would not.