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

Less: Unknown word CssSyntaxError #138

Open
XhmikosR opened this issue Mar 22, 2019 · 8 comments
Open

Less: Unknown word CssSyntaxError #138

XhmikosR opened this issue Mar 22, 2019 · 8 comments

Comments

@XhmikosR
Copy link

Errors

Running "stylelint:dist" (stylelint) task

<input css 1>
 51:2  ×  Unknown word   CssSyntaxError

Expected Behavior

No errors to be thrown

How can we reproduce the behavior?

I will try to pinpoint what exactly is causing this, but in case anyone wants to give it a go just checkout the v3-dev branch of https://github.com/twbs/bootstrap.git

@XhmikosR
Copy link
Author

All right, it seems the minum less code that triggers this is:

//** `<input>` background color

@XhmikosR
Copy link
Author

Hmm, maybe this one is an issue with stylelint. Let me make an issue there too.

@XhmikosR
Copy link
Author

XhmikosR commented Mar 22, 2019

Scratch all the above. After further looking into this it does seems it's a new regression here.

I will try to provide a patch in the next days.

EDIT:

Actually, this triggers the error:

//** Horizontal offset for forms and lists.

but this does not:

// Horizontal offset for forms and lists.

Which doesn't make any sense since you cover this case in your tests.

@shellscape
Copy link
Owner

Thanks for reporting this. It might be due to the two asterisks in a row, possible edge case. I might have time tonight to take a look, otherwise might have to wait until Monday (will be heading out of town).

(minor side note: please don't modify the issue template, and do please use the Edit function rather than multiple comments. I was pretty confused until I got to your last comment)

@XhmikosR
Copy link
Author

XhmikosR commented Mar 22, 2019 via email

@shellscape
Copy link
Owner

I just ran your sample LESS and this was the result I received:

Sample:

`//** Horizontal offset for forms and lists.`

Result:

Comment {
  raws: { before: '', begin: '//', left: '', right: '' },
  type: 'comment',
  parent:
   Root {
     raws: { semicolon: false, after: '' },
     type: 'root',
     nodes: [ [Circular] ],
     source: { input: [Input], start: [Object] } },
  source:
   { start: { line: 1, column: 1 },
     input:
      Input {
        css: '//** Horizontal offset for forms and lists.',
        hasBOM: false,
        id: '<input css 1>' },
     end: { line: 1, column: 2 } },
  inline: true,
  text: '** Horizontal offset for forms and lists.' }

However, when I run this sample:

`//** Horizontal offset for forms and lists.\n`

I get a CssSyntaxError. I'm not sure if this is what you were eluding to, but it would seem that a comment with a leading asterisk and ending with a newline causes this problem. I also confirmed this on a small sample //*a\n.

@XhmikosR
Copy link
Author

Yes, it seems the newline is causing the error indeed. Because whatever I tried as one line, worked fine in your tests.

Just to make sure everything is fine, I will confirm later with our v3-dev branch.

@XhmikosR
Copy link
Author

I tried to find a solution to this to no avail. It does throw if I do '//** Horizontal offset for forms and lists.\n'.

Let me know if there's something else I can do to help.

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

No branches or pull requests

2 participants