TurboDocx / html-to-docx

HTML to DOCX converter
https://TurboDocx.com
MIT License
48 stars 5 forks source link

Request to Port Fix from Old Repo: add `em` tag to support italic in those cases #44

Closed shareefalis closed 1 month ago

shareefalis commented 1 month ago

Hi there!

We have an app that uses this library, and it would be great to port the changes from the old repo. Currently, I’m using a temporary workaround that resolves the issue by converting the <em> tag to the <i> tag.

Here’s the PR that fixes this, although it was never merged into the old repo: https://github.com/privateOmega/html-to-docx/pull/226/

Thanks!

nicolasiscoding commented 1 month ago

Hey- we have support for the italics tag. Are you saying in certain scenarios it is not working @shareefalis ?

https://github.com/TurboDocx/html-to-docx/blob/main/src/helpers/xml-builder.js#L704

shareefalis commented 1 month ago

Oh thank, i see, yeah it is not not working in some scenario like multiple format on the same line, our dom is structured

Screenshot 2024-09-21I at 8 57 27 AM

here is the the browser rendering

Screenshot 2024-09-21 at 8 59 03 AM

output of the exported docx in microsoft word

Screenshot 2024-09-21 at 9 28 02 AM
shareefalis commented 1 month ago

Let me know if there are some more info i can provide to you guys and it is an awesome library btw!

nicolasiscoding commented 1 month ago

Can you provide a full repro? And on top of that, if you are able to make the PR that would help us a lot too (juggling a few things).

Glad you like the library 😃

On Sat, Sep 21, 2024 at 10:32 AM Shareef Ali @.***> wrote:

Let me know if there are some more info i can provide to you guys and it is an awesome library btw!

— Reply to this email directly, view it on GitHub https://github.com/TurboDocx/html-to-docx/issues/44#issuecomment-2365209372, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHLNTTET5V7CFBGUUBIDQDZXV7PJAVCNFSM6AAAAABOSWAVHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRVGIYDSMZXGI . You are receiving this because you commented.Message ID: @.***>

shareefalis commented 1 month ago

https://quilljs.com/playground/snow#codeN4Ig9AlgdgJgpgDwHQAsAuBbANiAXCAHhggDcACCGAXgB0Q5i0B7AJzoD4CxiT2ap+BAM4BjFhAAOaMkJYja4aPGQArIRy6jxU9iAA0i2IiRq8IEUyhDpARwCuELFjJUyUOAHcyARQdOAFADkAMQMEMwsgXpkwPxkZBhMMHZYcEK4MXHxZMxMWABGAIYsGQDaWdlkpcBkKHCF8CVVAIzRAEzRAGaFWEJwALpkAL79ehXZpYH5eTBRZIHhPRAic4F2RixY0HCBo+PxkxAYhQDmO9GBFvAAtPlYTCIA1rtjUJV7b8Ov8RJYhSJwFAzOBNQIAYSYGAkTD6ZEKbzgEmWSBRUSyaDqGDgGUCQigTA8czAYDIrHm+Ts+TuO34QwAlABufgWKzSeBYNCFFyZT50JgSdR4KrjGp0aB9FhoOgZOgAFTgUNYxQAnnRonRCmg0OIKWg0tKYmQ6NMsDADdq7HBhl8RUaQOKQVKhXQ7TbPvFbWKrI6DXR7iwFWq7ZrtRBdfqhaL7ZytiJzSxLdaht9slGHZLfSBXcnxp77d6M86QPZHFggxqtTq7HrBRko+tGlt3PHE0M3fF+rSmQIoMSyABlODSAAicA5XOgPj8zgAooxWPwS04kH00BCoHqN0J-OzOYzmZZrLVMM5XEusEgzmhB8cN8sABKygCyABl-IyjVAWUI8nAkPcTn8dBsDpEAhiAA Here is a link to the playground.. this output to console log

<p><strong>Temporary</strong> <em>lorem</em> <u>quill</u></p>

pipe this to html to docx library

shareefalis commented 1 month ago

I think you are missing. em here https://github.com/TurboDocx/html-to-docx/blob/main/src/helpers/xml-builder.js#L857

shareefalis commented 1 month ago

https://github.com/TurboDocx/html-to-docx/pull/45/

nicolasiscoding commented 1 month ago

addressed in #45