Skip to content

Conversation

rasamassen
Copy link

@rasamassen rasamassen commented Sep 9, 2025

Add missing features in Paragraph and fix issues with existing features.

Description

  • Adds widowControl, keepNext, keepLines, contextualSpacing, and suppressAutoHyphens
  • Fixes hasPageBreakBefore() triggering wrong RTF tag (was using \page, should be using \pagebb).
  • Fixes alignment to use SimpleType::Jc exclusively and adds missing alignments
  • Fixes bidi to include the \rtlpar direction control

Unsolved Issues

  • Widow/Orphan control is default "off" in RTF (even if it wasn't set in \RTF\Part\Document.php, as it currently is), but is default "on" in most modern document programs (Microsoft Word, Google Docs, etc.). In Paragraph, Widow/Orphan control is default "on", which means every paragraph has to manually override the document level setting. Unfortunately, there's currently no way to check the Widow/Orphan settings of the entire document (there's nothing in Settings), but it would be simpler output if there was a Document-level setting that could be checked, and only print the opposite setting if set at the document level. The way things are works, but it's less than ideal setting this variable every paragraph.

Checklist:

  • My CI is 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog

@coveralls
Copy link

coveralls commented Sep 9, 2025

Coverage Status

coverage: 96.763% (+0.006%) from 96.757%
when pulling b394c75 on rasamassen:paragraph
into 0ab0b49 on PHPOffice:master.

@rasamassen rasamassen changed the title RTF Writer: Add Pagination to Paragraph RTF Writer: Add Missing Features to Paragraph Oct 4, 2025
@rasamassen rasamassen changed the title RTF Writer: Add Missing Features to Paragraph RTF Writer: Paragraph - Add Missing Features Oct 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants