Coder Social home page Coder Social logo

Image replace about docxmustache HOT 4 CLOSED

wrklst avatar wrklst commented on May 19, 2024
Image replace

from docxmustache.

Comments (4)

tobiasvielmetter avatar tobiasvielmetter commented on May 19, 2024 1

from docxmustache.

tobiasvielmetter avatar tobiasvielmetter commented on May 19, 2024 1

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.

medeirosrafael avatar medeirosrafael commented on May 19, 2024

I got it. In Libreoffice i need put the {{img_url}} tag in a ghost field (LOL!).
Screenshot from 2019-08-19 08-36-04

from docxmustache.

medeirosrafael avatar medeirosrafael commented on May 19, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.