From b209fec72bd277c0452d4f5891c31f320612dc2a Mon Sep 17 00:00:00 2001 From: Nishant Bhatt Date: Mon, 3 Jun 2019 15:44:10 +0200 Subject: [PATCH] To suport preseve text inside sub container if we use preseve text inside table, issue fix https://stackoverflow.com/questions/33070424/phpword-cannot-add-preservetext-in-section --- src/PhpWord/Element/AbstractContainer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Element/AbstractContainer.php b/src/PhpWord/Element/AbstractContainer.php index 204d4a73..74aabb19 100644 --- a/src/PhpWord/Element/AbstractContainer.php +++ b/src/PhpWord/Element/AbstractContainer.php @@ -254,7 +254,7 @@ abstract class AbstractContainer extends AbstractElement // Special condition, e.g. preservetext can only exists in cell when // the cell is located in header or footer $validSubcontainers = array( - 'PreserveText' => array(array('Cell'), array('Header', 'Footer')), + 'PreserveText' => array(array('Cell'), array('Header', 'Footer', 'Section')), 'Footnote' => array(array('Cell', 'TextRun'), array('Section')), 'Endnote' => array(array('Cell', 'TextRun'), array('Section')), );