karnov / htmltoword

Ruby html to word gem
MIT License
179 stars 71 forks source link

Issue with `p` containing formatted text and a br #41

Closed senny closed 8 years ago

senny commented 8 years ago

There seems to be something wrong when using formatted text and a br inside the same p tag. A minimal reproduction looks like this:

<p><strong>bold:</strong> text.<br />after br</p>

The resulting word document looks like this:

screen shot 2015-12-17 at 10 46 12

and the WordprocessingML looks like this:

<w:p xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage" xmlns:str="http://exslt.org/strings" xmlns:fn="http://www.w3.org/2005/xpath-functions">
  <w:r>
    <w:rPr>
      <w:b/>
    </w:rPr>
    <w:t xml:space="preserve">bold:</w:t>
  </w:r>
  <w:r>
    <w:t xml:space="preserve"> text.</w:t>
  </w:r>
</w:p>
senny commented 8 years ago

maybe related to #38

senny commented 8 years ago

I've started to work on a custom solution to convert HTML to WordML. I'm closing the issue as I am no longer using this gem. Feel free to reopen if you want to keep track of the issue. Thanks for your time :yellow_heart: