privateOmega / html-to-docx

HTML to DOCX converter
MIT License
373 stars 140 forks source link

STRIKE THROUGH Not working #237

Open satyajitnayk opened 6 months ago

satyajitnayk commented 6 months ago

This commit seems to be implementing strike through feature. but it does not work

Code to reproduce

const fs = require('fs');
const HTMLtoDOCX = require('html-to-docx');
const filePath = './example.docx';

const htmlString = `<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>Document</title>
    </head>
    <body>
        <s>STRIKE</s>
        <del>STRIKE</del>
    </body>
</html>`;

(async () => {
  const fileBuffer = await HTMLtoDOCX(htmlString, null, {
    table: { row: { cantSplit: true } },
    footer: true,
    pageNumber: true,
  });

  fs.writeFile(filePath, fileBuffer, (error) => {
    if (error) {
      console.log('Docx file creation failed');
      return;
    }
    console.log('Docx file created successfully');
  });
})();

example.docx output DOCX:

image
satyajitnayk commented 6 months ago
maxping76 commented 2 months ago

Same problem, please accept PR from @satyajitnayk

ccamba commented 2 months ago

Hi @privateOmega, can give a solution please !