First of all, thanks for the great work !
I installed Weasyprint with the AUR package, and I am getting this error while trying to generate a pdf for a text-only page (the only css is a class for page-break) :
weasyprint http://localhost:1291/pdf/Hisdesat test.pdf
Traceback (most recent call last):
File "/usr/bin/weasyprint", line 9, in <module>
load_entry_point('WeasyPrint==0.11', 'console_scripts', 'weasyprint')()
File "/usr/lib/python3.2/site-packages/weasyprint/__main__.py", line 79, in main
getattr(html, 'write_' + format_)(output, stylesheets=args.stylesheet)
File "/usr/lib/python3.2/site-packages/weasyprint/__init__.py", line 124, in write_pdf
File "/usr/lib/python3.2/site-packages/weasyprint/document.py", line 171, in write_pdf
File "/usr/lib/python3.2/site-packages/weasyprint/pdf.py", line 420, in write_pdf_metadata
bookmarks, links = gather_metadata(document)
File "/usr/lib/python3.2/site-packages/weasyprint/pdf.py", line 416, in gather_metadata
return process_bookmarks(bookmarks), resolved_links_by_page
File "/usr/lib/python3.2/site-packages/weasyprint/pdf.py", line 319, in process_bookmarks
k += 1 + level_shifts.pop()
IndexError: pop from empty list
I need more data, do tell me
Thanks for reporting this. Could you provide the HTML and CSS you used, so we can reproduce the bug?
Sure, I forgot to do it, sorry !
Hum, this is plain text. I’d need the HTML source.
Désolé d’insister :)
Looks like I was out of it yesterday !
GIst updated : https://gist.github.com/3152429
Great! I can reproduce the bug. I’ll have a look at it.
Fixed #2: Crash in PDF outlines with malformed bookmark-level sequence.
The bug occurred with some inconsistent sequence for title levels like <h1>, <h3>, <h2>. We chose not to have blank entries in the PDF output so there is an algorithm that does some transformation. In your document, <h4> titles will not all be at the same depth.
Thanks you very much, I am glad this ill-coded html could help you !