Git Product home page Git Product logo

Comments (11)

 avatar commented on May 18, 2024

I am having the same issue here. Can it be fixed?

from docx-templates.

johannordin avatar johannordin commented on May 18, 2024

Yeah me to. :(

from docx-templates.

vdechef avatar vdechef commented on May 18, 2024

Sorry, I don't have much free time these days. I will try to investigate this problem next week.

from docx-templates.

guigrpa avatar guigrpa commented on May 18, 2024

Thanks for the help, @vdechef!

from docx-templates.

Waigie avatar Waigie commented on May 18, 2024

For those having the same issue, I found a little workaround for the problem. If you use a different cmdDelimiter (eg. ---) for the html command an process the document twice you get the expected result.
Definitly not an elegant solution, but a working one.

from docx-templates.

johannordin avatar johannordin commented on May 18, 2024

@Waigie could you elaborate? I dont quite get it :)
Edit:

  1. Change +++ to --- in your HTML command in the template
  2. Process the template with default cmdDelimiter, leaving --- in place.
  3. Process the output (as template) with --- as cmdDelimiter.
  4. Profit!

thanks @Waigie !

from docx-templates.

guigrpa avatar guigrpa commented on May 18, 2024

Hi there! Could you please check v2.9.0-rc.0? It should solve this issue…

from docx-templates.

vdechef avatar vdechef commented on May 18, 2024

The problem occurs also with +++LINK+++
It happens because we forgot to use await when calling processHtml, processImage, and processLink
I fixed this, but I still have an issue with a corrupted file (maybe another problem with promises elsewhere).

from docx-templates.

guigrpa avatar guigrpa commented on May 18, 2024

I think the issue mentioned by @vdechef is related. Could you please install v2.9.0-rc.0 and tell me if it solves your use cases?

from docx-templates.

guigrpa avatar guigrpa commented on May 18, 2024

Btw, @vdechef: you identified part of the problem (missing awaits in those functions), but there's more: when you read a file, JSZip doesn't give you the updated version of a file if you've included it in the zip file from a previous section of your code. This is, in principle, solved in v2.9.0-rc.0.

from docx-templates.

vdechef avatar vdechef commented on May 18, 2024

Yes, that's what I just realized : the HTML files generated were corrupted (they included a <?xml [...] ?> header).
Your fix works fine. Thanks, it was a tricky one ! 👍
I would just like to add a small improvement regarding Content.xml for html rels (see PR #47 ) .

from docx-templates.

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.