fix(less): remove CRs from inline comments (#5334)
The issue here is that less parser somehow included CRs in `comment.raws.content`, but it was hidden by the wrong trailing space elimination previously, which was fixed by #5165. We already have such tests but it's not reproducible in AppVeyor since they use LF ([`core.autocrlf=input`](https://stackoverflow.com/a/20653073)).master
parent
275b0543c8
commit
0878a6a3e7
|
@ -110,7 +110,11 @@ function genericPrint(path, options, print) {
|
|||
}
|
||||
case "css-comment": {
|
||||
if (node.raws.content) {
|
||||
return node.raws.content;
|
||||
return (
|
||||
node.raws.content
|
||||
// there's a bug in the less parser that trailing `\r`s are included in inline comments
|
||||
.replace(/^(\/\/[^]+)\r+$/, "$1")
|
||||
);
|
||||
}
|
||||
const text = options.originalText.slice(
|
||||
options.locStart(node),
|
||||
|
|
Loading…
Reference in New Issue