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

Prevent endless loop and index out of range in pagination #798

merged 1 commit into from
Feb 11, 2019


Copy link

@Tontyna Tontyna commented Feb 10, 2019

Ensures re-pagination while avoiding endless loops and 'list index out of range'.
Should fix #794

The endless loop can (could) easily be triggered.

The aforesaid 'list index out of range' error happens when resolving page based counters decreases the number of pages.
Though I tried hard I was unable to create an HTML/CSS that per se produced the error, had to tweak the source code to artificailly enforce re-pagination with decreasing pages, hence I'm highly interested to see @guateandrew's real-world document, or at least the CSS?

Copy link

liZe commented Feb 11, 2019

Thanks a lot @Tontyna (as usual).

@liZe liZe merged commit 92c6a3c into Kozea:master Feb 11, 2019
@liZe liZe added this to the 45 milestone Feb 11, 2019
Copy link
Contributor Author

Tontyna commented Feb 11, 2019

This time no conflicts with the famous nonexistent guide of style 🎉

@Tontyna Tontyna deleted the repagination branch February 11, 2019 10:47
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Feb 21, 2019
Version 45

Released on 2019-02-20.

WeasyPrint now has a `code of conduct

A new website has been launched, with beautiful and useful graphs about speed
and memory use across versions: check `WeasyPerf


* Python 3.5+ is now needed, Python 3.4 is not supported anymore

Bug fixes:

* `798 <>`_:
  Prevent endless loop and index out of range in pagination
* `767 <>`_:
  Add a ``--quiet`` CLI parameter
* `784 <>`_:
  Fix library loading on Alpine
* `791 <>`_:
  Use path2url in tests for Windows
* `789 <>`_:
  Add LICENSE file to distributed sources
* `788 <>`_:
  Fix pending references
* `780 <>`_:
  Don't draw patterns for empty page backgrounds
* `774 <>`_:
  Don't crash when links include quotes
* `637 <>`_:
  Fix a problem with justified text
* `763 <>`_:
  Launch tests with Python 3.7
* `704 <>`_:
  Fix a corner case with tables
* `804 <>`_:
  Don't logger handlers defined before importing WeasyPrint
* `109 <>`_,
  `748 <>`_:
  Don't include punctuation for hyphenation
* `770 <>`_:
  Don't crash when people use uppercase words from old-fashioned Microsoft
  fonts in tables, especially when there's an 5th column
* Use a `separate logger
  <>`_ to
  report the rendering process
* Add a ``--debug`` CLI parameter and set debug level for unknown prefixed CSS
* Define minimal versions of Python and setuptools in setup.cfg


* `796 <>`_:
  Fix a small typo in the tutorial
* `792 <>`_:
  Document no alignement character support
* `773 <>`_:
  Fix phrasing in Hacking section
* `402 <>`_:
  Add a paragraph about fontconfig error
* `764 <>`_:
  Fix list of dependencies for Alpine
* Fix API documentation of HTML and CSS classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Weird error in layout/ - list index out of range
2 participants