Skip to content

Conversation

@brettins
Copy link

Summary

  • Text elements inside ListItemRun containers were being incorrectly wrapped in <p> tags
  • This caused list items to be rendered as multiple separate paragraphs instead of a single inline list item
  • Added 'ListItemRun' to the $withoutP check in Container.php alongside TextRun, Footnote, and Endnote

Example

Before (broken):

<p>Communicating </p>
<p><span style="font-weight: bold;">COMPANY NAME</span></p>
<p>'s</p>
<p> commitment to health and safety </p>

After (fixed):

Communicating <span style="font-weight: bold;">COMPANY NAME</span>'s commitment to health and safety

Test plan

  • Import DOCX with list items containing multiple text runs (bold, italic, etc.)
  • Verify HTML output has inline text instead of separate paragraphs

🤖 Generated with Claude Code

Text elements inside ListItemRun containers were being incorrectly
wrapped in <p> tags, causing list items to be rendered as multiple
separate paragraphs instead of a single inline list item.

Added 'ListItemRun' to the withoutP check in Container.php alongside
TextRun, Footnote, and Endnote.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
oleibman added a commit to oleibman/PHPWord that referenced this pull request Jan 21, 2026
@brettins
Copy link
Author

Implemented properly by @oleibman in oleibman@fd7606b - closing.

@brettins brettins closed this Jan 26, 2026
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.

1 participant