We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A clear and concise description of what the bug is.
Please provide a code sample that reproduces the issue.
$phpWord = IOFactory::load($wordFile); $wordText = '';
foreach ($phpWord->getSections() as $section) { $elements = $section->getElements(); $numElements = count($elements); foreach ($elements as $key => $element) { if ($element instanceof \PhpOffice\PhpWord\Element\TextRun) { foreach ($element->getElements() as $textElement) { if ($textElement instanceof \PhpOffice\PhpWord\Element\Text) { $wordText .= $textElement->getText(); } } } elseif ($element instanceof \PhpOffice\PhpWord\Element\Text) { $wordText .= $element->getText(); } // Add a line break if it's not the last element in the section. if ($key < $numElements - 1) { $wordText .= PHP_EOL; } } } $formattedText = $wordText;
A clear and concise description of what you expected to happen.
What is the current behavior?
Please fill in your environment information:
The text was updated successfully, but these errors were encountered:
To add a line break you need to pass </w:t><w:br/><w:t> instead PHP_EOL I saw this in #2522 I hope this will be added in the next version
</w:t><w:br/><w:t>
PHP_EOL
Sorry, something went wrong.
Fixed in #2522
No branches or pull requests
Describe the Bug
A clear and concise description of what the bug is.
Steps to Reproduce
Please provide a code sample that reproduces the issue.
$phpWord = IOFactory::load($wordFile);
$wordText = '';
Expected Behavior
A clear and concise description of what you expected to happen.
Current Behavior
What is the current behavior?
Context
Please fill in your environment information:
The text was updated successfully, but these errors were encountered: