View Single Post
Old 01-11-2021, 02:13 PM   #67
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,440
Karma: 6733960
Join Date: Nov 2009
Device: many
Okay I tested cssparser_v2.1 against the following broken css

Code:
.kevin {
    color: blue;


.new { color: Teal; background-color: #FFFF00; }
.deleted { color: red; background-color: #FFFF00; text-decoration: line-through; }
And it produced 2 errors:

Error: 5: Unexpected character '.'in property name
Error: 5: Unexpected character '{'in property name

and the following output:

Code:
.kevin {
    color:blue;
    newcolor:Teal;
    background-color:#FFFF00;
}
So without a proper closing selector it kept trying to build the current selector list of properties and values and of course then detected the "{" as being an illegal part of a property name.


If the snippet:
Code:
.kevin {
    color: blue;
appeared at the very end of the css, it seems to not detect it at all.

I will add a test at the end of the css parsing that will keep track of nest level and generate an error if not properly nested.
KevinH is offline   Reply With Quote