From 2ac23692b3faad4573e28ad61dfd8930eae5e9f5 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Mon, 1 Sep 2025 10:16:35 -0500 Subject: [PATCH 1/4] Fix TextBreak.php Returns line return instead of paragraph return on textrun, footnote, and endnote. --- src/PhpWord/Writer/RTF/Element/TextBreak.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PhpWord/Writer/RTF/Element/TextBreak.php b/src/PhpWord/Writer/RTF/Element/TextBreak.php index d74bf23dcb..c7924b0f8d 100644 --- a/src/PhpWord/Writer/RTF/Element/TextBreak.php +++ b/src/PhpWord/Writer/RTF/Element/TextBreak.php @@ -36,6 +36,10 @@ public function write() $parentWriter = $this->parentWriter; $parentWriter->setLastParagraphStyle(); - return '\pard\par' . PHP_EOL; + if ($this->withoutP) { + return '\line' . PHP_EOL; + } else { + return '\pard\par' . PHP_EOL; + } } } From 969a10a30c31d96c8f7b03b1f1d19009d1e94bc7 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Mon, 1 Sep 2025 19:08:01 -0500 Subject: [PATCH 2/4] Update TextBreak.php - Fix Formatting --- src/PhpWord/Writer/RTF/Element/TextBreak.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpWord/Writer/RTF/Element/TextBreak.php b/src/PhpWord/Writer/RTF/Element/TextBreak.php index c7924b0f8d..656da1c389 100644 --- a/src/PhpWord/Writer/RTF/Element/TextBreak.php +++ b/src/PhpWord/Writer/RTF/Element/TextBreak.php @@ -38,8 +38,8 @@ public function write() if ($this->withoutP) { return '\line' . PHP_EOL; - } else { - return '\pard\par' . PHP_EOL; } + + return '\pard\par' . PHP_EOL; } } From ea46753af69e48a7d0ec7d7ffada8ef827a97bc2 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Mon, 1 Sep 2025 19:11:12 -0500 Subject: [PATCH 3/4] Update TextBreak.php - Fix formatting --- src/PhpWord/Writer/RTF/Element/TextBreak.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Writer/RTF/Element/TextBreak.php b/src/PhpWord/Writer/RTF/Element/TextBreak.php index 656da1c389..c533a32f45 100644 --- a/src/PhpWord/Writer/RTF/Element/TextBreak.php +++ b/src/PhpWord/Writer/RTF/Element/TextBreak.php @@ -39,7 +39,7 @@ public function write() if ($this->withoutP) { return '\line' . PHP_EOL; } - + return '\pard\par' . PHP_EOL; } } From 6a28762467b821aee3a0a49d29979dd7674772b9 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Mon, 1 Sep 2025 21:59:42 -0500 Subject: [PATCH 4/4] Update 1.5.0.md - Changelog for Pull 2816 --- docs/changes/1.x/1.5.0.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changes/1.x/1.5.0.md b/docs/changes/1.x/1.5.0.md index b96865bada..f260d5a88a 100644 --- a/docs/changes/1.x/1.5.0.md +++ b/docs/changes/1.x/1.5.0.md @@ -7,6 +7,7 @@ ### Bug fixes - Set writeAttribute return type by [@radarhere](https://github.com/radarhere) fixing [#2204](https://github.com/PHPOffice/PHPWord/issues/2204) in [#2776](https://github.com/PHPOffice/PHPWord/pull/2776) +- Writer RTF: Fix paragraph return when it should be line return in TextBreak by [@rasamassen](https://github.com/rasamassen) in [#2816](https://github.com/PHPOffice/PHPWord/pull/2816) ### Miscellaneous @@ -16,4 +17,4 @@ ### BC Breaks -### Notes \ No newline at end of file +### Notes