Skip to content

feat: support CSS3 break-after:page#61

Merged
dfop02 merged 7 commits intodfop02:release/1.1.4from
chrisonntag:feature/support-break-after
Feb 16, 2026
Merged

feat: support CSS3 break-after:page#61
dfop02 merged 7 commits intodfop02:release/1.1.4from
chrisonntag:feature/support-break-after

Conversation

@chrisonntag
Copy link

Description

The current page break handling on divs only recognized the deprecated page-break-after: always property. However, modern browsers and CSS generators use break-after: page.

This extends the current logic by a more detailed regex to catch the deprecated page-break-after, as well as break-after and handle whitespace variations and !important flags.

Checklist Before Requesting a Review

  • I have performed a self-review of my code.
  • My code follows the project's coding style and guidelines.
  • I have run tests and verified that all existing and new tests pass.
  • I have added new tests to cover my changes.

Test issues

I've run all existing and new tests, but both on this branch and the main branch the following test failes:

======================================================================
FAIL: test_local_img (test_h4d.OutputTest.test_local_img)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/christoph/projects/html4docx/tests/test_h4d.py", line 388, in test_local_img
    assert image_found, "No image was found in the document"
           ^^^^^^^^^^^
AssertionError: No image was found in the document

----------------------------------------------------------------------
Ran 84 tests in 6.770s

FAILED (failures=1)

Copilot AI and others added 4 commits February 4, 2026 15:08
Co-authored-by: chrisonntag <5236298+chrisonntag@users.noreply.github.com>
Co-authored-by: chrisonntag <5236298+chrisonntag@users.noreply.github.com>
…itions

Support CSS3 break-after:page alongside deprecated CSS2 page-break-after:always
@dfop02 dfop02 self-requested a review February 10, 2026 17:57
@dfop02 dfop02 self-assigned this Feb 10, 2026
@dfop02 dfop02 added the bug Something isn't working label Feb 10, 2026
@chrisonntag chrisonntag requested a review from dfop02 February 12, 2026 10:58
Copy link
Owner

@dfop02 dfop02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! Could you just add a Changelog entry before I merge, please?

@dfop02 dfop02 merged commit a479afb into dfop02:release/1.1.4 Feb 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments