less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
16.99k stars 3.41k forks source link

fix: file path is not an absolute path when startswith "#" #3736

Open YourWildDad opened 2 years ago

YourWildDad commented 2 years ago

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:

matthew-dean commented 1 year ago

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.