Open Hydro8 opened 5 years ago
did you try with version 0.16?
Hello, i'm getting the same issue
Thanks @Hydro8 🥇 your custom code works. Really Nice. I changed my inner function code just like yours. your code works more flexible for .docx template and it's comfy for me...⭐️⭐️⭐️
Well, the (MsWord) template that I use for implement replaceBlock method
is Ms Word 2019 for Mac. :-)
here's my custom replaceBlock function code here.txt
This is:
Expected Behavior
Be able to delete or clone block in a long text.
Current Behavior
I'm able to delete block (for example) in a small word file. If file is too long, deleteBlock won't work.
Failure Information
I tried with a brand new document but I have the same problem. For exemple I use a simple template with this text :
It works, but if I add one paragraph, it doesn't work :
I can make this work by modify templateProcessor.php with this lines :
preg_match( '/\$\{' . $blockname . '}.*\$\{\/' . $blockname . '}/is', $this->tempDocumentMainPart, $matches ); if (isset($matches[0])) { $this->tempDocumentMainPart = str_replace( $matches[0], $replacement, $this->tempDocumentMainPart ); }
But in this case I have a white line so not very cool.How to Reproduce
Please provide a code sample that reproduces the issue.
Here a link to download word files :
https://wetransfer.com/downloads/b6731f6817ce7a8f0991546b02d4596120190128110140/5babac
Context