Skip to content
New issue

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

Replace macros with multiple elements by splitting existing text runs/paragraphs instead of replacing them #2607

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jensschuppe
Copy link

Description

setComplexValue() can only replace macros with a single OOXML element. #2562 tries to make it support Section elements for inserting a batch of elements (e.g. created from HTML).

This PR is a different approach with a separate method setElementsValue() which receives an array of elements and tries to split the paragraph or text element containing the macro variable instead of replacing it. No new paragraph is added if the replacement is inline-only (Text elements without a TextRun).

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

@coveralls
Copy link

Coverage Status

coverage: 96.803% (-0.4%) from 97.217%
when pulling 795f2ec on jensschuppe:replaceMacroMultipleElements
into 8b891bb on PHPOffice:master.

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