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

Fix cloneBlock issue #2006

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lexdewilligen
Copy link

@lexdewilligen lexdewilligen commented Jan 20, 2021

Description

The regex function in cloneBlock may be too complicated or result in too many matches. Therefore, it can occur that the function results in no matches and therefore doesn't replace any blocks. I've solved this issue by making the regex more precise (by adding an extra group) and this solves the issue. It could probably also be fixed by increasing one of these PHP configurations. This however is not what should be expected from users of this package.

Might fix many cloneBlock and replaceBlock issues
https://github.com/PHPOffice/PHPWord/issues?q=cloneBlock
https://github.com/PHPOffice/PHPWord/issues?q=replaceBlock

@troosan troosan added this to the v0.18.0 milestone Feb 7, 2021
@troosan troosan removed this from the v0.18.0 milestone Feb 7, 2021
@troosan
Copy link
Contributor

troosan commented Apr 15, 2021

@lexdewilligen is this issue still present in 0.18.0?
might it have been fixed by #1809 ?

@thePanz
Copy link

thePanz commented Jan 28, 2022

@troosan I can confirm that the issue is still present with the latest release 0.18.2

This PR fixes the issue. Thank you @lexdewilligen !

@PowerKiKi PowerKiKi changed the base branch from develop to master November 16, 2022 21:15
@Progi1984 Progi1984 force-pushed the master branch 3 times, most recently from 2d9f999 to e458249 Compare August 30, 2023 11:56
@chinmayshah24
Copy link

This doesn't always work. It breaks when the cloneBlock is around a table. It doesn't generate the values inside the block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants