Unclosed strings should produce parsing error
Closed this issue · 2 comments
jnothman commented
I had expected unclosed strings to produce a syntax error, whether or not the string was automatically closed by the parser:
>>> tinycss2.parse_declaration_list('font-family: "blah')[0].value
[<WhitespaceToken>, <StringToken "blah">]
>>> tinycss2.parse_declaration_list('font-family: "blah; font-weight: 600')[0].value
[<WhitespaceToken>, <StringToken "blah; font-weight: 600">]
I think it would be valuable to have a syntax error in the latter case to help explain why the font-weight was missed.
liZe commented
liZe commented
As this change wouldn't help to add any new feature, I suppose that keeping this behavior is OK until the draft is released.
The draft has been released, I've added a parse error. This change makes WeasyPrint reject rules with an EOF character, just as other browsers do.