Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#64 Invalid rule stops processing the following declarations

0.9.20
closed
RBRi
None
1
2016-07-17
2016-07-07
No

My css file contains this invalid line:
.HistoryPage{}0.75in0.75in0.25in1in
The problem is that the parser ignores the rest of the document. Is it possible to just skip over the broken line?

here's what I see in the stderr:

null [394:12] Error in style rule. (Invalid token ".5". Was expecting one of: <S>, <LBRACE>, ".", ":", "[", <COMMA>, <HASH>, <S>.)
null [394:12] Ignoring the following declarations in this rule.
null [454:138] Error in declaration. (Invalid token ".". Was expecting one of: <S>, ":".)
null [641:15] Error in style sheet. (Invalid token "0.75in0". Was expecting one of: <EOF>, <S>, <IDENT>, "<!--", "-->", ".", ":", "*", "[", <HASH>, <IMPORT_SYM>, <PAGE_SYM>, <MEDIA_SYM>, <ATKEYWORD>.)

Have tried with 0.9.19 maven build

Discussion

  • John Macintosh

    John Macintosh - 2016-07-07

    Forgot to mention, the browsers I have tested with so far, including latest Chrome and Firefox, have no problem interpreting the rules following the invalid declaration.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous

    Anonymous - 2016-07-16

    Looks like browsers are restarting after the next closing bracket

     
  • RBRi

    RBRi - 2016-07-16
    • status: open --> accepted
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2016-07-17
    • Group: 0.9.19 --> 0.9.20
     
  • RBRi

    RBRi - 2016-07-17
    • status: accepted --> closed
     
  • RBRi

    RBRi - 2016-07-17

    This is hopefully fixed. Please try the latest snapshot build.

     
    • John Macintosh

      John Macintosh - 2016-07-21

      Thanks for working on this. I have tested the 0.9.20-SNAPSHOT; there is a problem however, the very next valid rule is skipped as well. I am not sure whether intentional or not, it'd be nice to have that fixed as well, if at all possible.

      Example:
      input:
      .red { color: red }
      .invalid{}0.75in0.75in0.25in1in
      .blue { color: blue }
      .green { color: green }

      output:
      .red { color: red }
      .invalid{}0.75in0.75in0.25in1in
      .green { color: green }

      Thus the .blue class rule is skipped.

       
      Last edit: John Macintosh 2016-07-21
      • RBRi

        RBRi - 2016-07-21

        Two reasons for this behaviour
        1. Browsers are doing the same (you can check this with the sample i have attached in the previous comment
        2. The parser needs to find some point to start with parsing again. And that is not that simple. The restart point is now the next '}'

         
        • John Macintosh

          John Macintosh - 2016-07-22

          I understand. I had an idea this might be the case, thanks for confirming.

           

Anonymous
Anonymous

Cancel  Add attachments