Comments (4)
from docxmustache.
Not sure this makes sense. If a \n /
is outside of the condition, it will be shown, no matter if the condition is met. The way to do your condition would be the following instead, so you dont have any unnecessary new lines, even if the condition is not met:
"
BLA BLA BLA BLA BLA{{#myCondition}}
xxxxxxxxxxxxxxxx
{{/myCondition}}
ZZZZZZZZZZZZZZZZZZZZz
"
from docxmustache.
I got it. In Libreoffice i need put the {{img_url}} tag in a ghost field (LOL!).
from docxmustache.
@tobiasvielmetter i was having a problem.. when my condition is not satisfied, a blank space still in document.
Example:
"
BLA BLA BLA BLA BLA
{{#myCondition}}
xxxxxxxxxxxxxxxx
{{/myCondition}}
ZZZZZZZZZZZZZZZZZZZZz
"
If myCondition is false the result is:
"
BLA BLA BLA BLA BLA
ZZZZZZZZZZZZZZZZZZZZz
"
instead of
"
BLA BLA BLA BLA BLA
ZZZZZZZZZZZZZZZZZZZZz
"
I solved locally adding
preg_match_all("'(<w:p>.*?</w:p>)'si", $this->word_doc, $matches);
foreach ($matches[0] as $match) {
if (strpos($match, '<w:t xml:space="preserve"></w:t>') !== false) {
$this->word_doc = str_replace($match, '', $this->word_doc);
}
}
in DocxMustache.php line 156..
Can i make a merge request?
from docxmustache.
Related Issues (20)
- Throw proper exceptions when XML is not valid
- Image Replacement seems to break images that are not supposed to be replaced
- Mustache tags seem to break if they are directly next to each other HOT 1
- Aligning image does not work properly with constraint, keeps image always to the left of the original contraint HOT 1
- Error when drawing elements are used for non images (eg shapes) HOT 1
- allow for odt format
- Get rid of Laravel File Dependency
- Object of class LibXMLError could not be converted to string HOT 1
- image quality seems to be bad on high dpi screens. HOT 1
- Invalid path if $storageDisk has `root` defined
- Header and Footer are not parsed HOT 1
- Get rid of UUID dependency
- Missing dot in PDF-Filepath
- Error calling execute function HOT 2
- Error on Document.xml HOT 5
- Cannot process file HOT 1
- Separate Class for HTML Conversion
- Improve README
- Image Replacer Method ImageReplacer() needs to be decomplexified
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docxmustache.