Describe the bug
It looks like the changes in https://github.com/LibrePDF/OpenPDF/pull/1348/files caused (some?) css files to stop loading with a silent unexpected EOF
To Reproduce
My css starts with
@page {
size: a4 portrait;
margin: 0;
}
@media print {
footer {
page-break-after: always;
}
}
which throws exception after handling of @ media element.
Expected behavior
CSS stylesheet is loaded and generated PDF is pretty
Screenshots
Current PDF (top left)

Correct PDF

System
- OS: MacOs and Windows
- Used font: NA
- OpenPDF version: 2.2.1
Additional context
the break inside this switch only breaks out of the switch and not the loop, around line 422 in org.openpdf.css.parser.CSSParser.java
switch (t.getType()) {
case RBRACE:
next();
break;
default:
ruleset(mediaRule);
}
Suggested fix, tested ok locally
if (t.getType() == Type.RBRACE) {
next();
break;
}
ruleset(mediaRule);
Describe the bug
It looks like the changes in https://github.com/LibrePDF/OpenPDF/pull/1348/files caused (some?) css files to stop loading with a silent unexpected EOF
To Reproduce
My css starts with
which throws exception after handling of @ media element.
Expected behavior
CSS stylesheet is loaded and generated PDF is pretty
Screenshots
Current PDF (top left)
Correct PDF
System
Additional context
the break inside this switch only breaks out of the switch and not the loop, around line 422 in org.openpdf.css.parser.CSSParser.java
Suggested fix, tested ok locally