Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting markdown to PDF: tuple index out of range #62

Open
TGoodhew opened this issue Oct 23, 2019 · 3 comments
Open

Error converting markdown to PDF: tuple index out of range #62

TGoodhew opened this issue Oct 23, 2019 · 3 comments

Comments

@TGoodhew
Copy link

I realized that I should have probably opened a new issue for this. I just commented on #16 with the stack from weasyprint. Stack is:

Traceback (most recent call last):
File "/home/demo/.local/bin/weasyprint", line 11, in
sys.exit(main())
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/main.py", line 212, in main
getattr(html, 'write_' + format_)(output, **kwargs)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/init.py", line 211, in write_pdf
font_config=font_config).write_pdf(
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/init.py", line 168, in render
font_config)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/document.py", line 393, in _render
[Page(page_box, enable_hinting) for page_box in page_boxes],
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/document.py", line 393, in
[Page(page_box, enable_hinting) for page_box in page_boxes],
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/init.py", line 126, in layout_document pages = list(make_all_pages(context, root_box, html, pages))
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/pages.py", line 803, in make_all_pages
page, resume_at = remake_page(i, context, root_box, html)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/pages.py", line 742, in remake_page
page_number, page_state)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/pages.py", line 553, in make_page
positioned_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 73, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/tables.py", line 432, in table_layout
all_groups_layout()
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/tables.py", line 417, in all_groups_layout skip_stack, position_y, max_position_y, page_is_empty))
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/tables.py", line 299, in body_groups_layout group, position_y, max_position_y, page_is_empty, skip_stack)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/tables.py", line 140, in group_layout
fixed_boxes=fixed_boxes)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout
absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 510, in block_container_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 63, in block_level_layout page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 77, in block_level_layout_switch
page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 130, in block_box_layout absolute_boxes, fixed_boxes, adjoining_margins)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 376, in block_container_layout for line, resume_at in lines_iterator:
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/inlines.py", line 53, in iter_line_boxes absolute_boxes, fixed_boxes, first_letter_style)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/inlines.py", line 70, in get_next_linebox skip_stack = skip_first_whitespace(linebox, skip_stack)
File "/home/demo/.local/lib/python3.6/site-packages/weasyprint/layout/inlines.py", line 210, in skip_first_whitespace result = skip_first_whitespace(box.children[index], next_skip_stack)
IndexError: tuple index out of range

TonyG

@marlonjan
Copy link

Having a similar problem here. Versions:

mkdocs==1.0.4
mkdocs-material==4.4.3
mkdocs-minify-plugin==0.2.1
mkdocs-pdf-export-plugin==0.5.5

@fschrempf
Copy link

Same issue here...

@fschrempf
Copy link

I boiled it down to this markdown snippet that triggers the error for me:

* List  
  This is the first stage bootloader (fsbl) for the
  [STM32MP trusted boot chain](test).

Changing arbitrary characters makes it go away and weasyprint alone does not seem to have any problem with converting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants