Error with nth-of-type(2n+1) CSS selector
I'm testing pagedjs on some HTML document that has the following CSS:
.wrap_quarter:nth-of-type(2n+1) {
clear: left;
}
Running pagedjs-cli test.html -o result.pdf
results in:
◴ Loading: test.html/usr/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217
throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
^
Error: Evaluation failed: Error: item doesn't belong to list
at List$6.remove (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:3536:20)
at Following.onRule (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:30526:14)
at /usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:372:26
at Array.forEach (<anonymous>)
at Hook.trigger (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:371:15)
at Object.enter (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:26303:24)
at Object.<anonymous> (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:11093:17)
at walkNode (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:11247:35)
at List$6.walkReducer (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:11271:62)
at List$6.reduce (/usr/lib/node_modules/pagedjs/dist/paged.polyfill.js:3274:19)
at ExecutionContext._evaluateInternal (/usr/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async ExecutionContext.evaluate (/usr/lib/node_modules/pagedjs-cli/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:106:16)
at async Printer.render (/usr/lib/node_modules/pagedjs-cli/src/printer.js:191:5)
at async Printer.pdf (/usr/lib/node_modules/pagedjs-cli/src/printer.js:297:16)
at async /usr/lib/node_modules/pagedjs-cli/bin/paged:162:14
If I change the selector's argument from 2n+1
to 2n
, then the error disappears.