Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List item bullets corrupted in Microsoft Word #73

Open
dv opened this issue Jul 9, 2018 · 1 comment
Open

List item bullets corrupted in Microsoft Word #73

dv opened this issue Jul 9, 2018 · 1 comment

Comments

@dv
Copy link

dv commented Jul 9, 2018

It seems list item bullets render as corrupt characters in Microsoft Word. No issue in other software we tried (Pages, Preview, ...).

require "htmltoword"

html = "<ul><li>Line 1</li><li>Line 2</li></ul>"
file = Htmltoword::Document.create_and_save(html, "test.docx")

Result:

  • gem version htmltoword-1.0.0
  • Microsoft Word for Mac 15.26 (160910)
  • Also received complaints from other people where the item bullet was rendered as ∉ (possibly on Windows this time)

After an initial comparison of the xml files of the corrupted list versus of a working list, it seems removing these lines:

      <w:rPr>
        <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
      </w:rPr>

from the numbering.xml file solves this problem (but might cause others, I'm not sure what these lines do), which might give a hint towards how to solve this.

@dv dv changed the title List bullets corrupted in Microsoft Word List item bullets corrupted in Microsoft Word Jul 9, 2018
@dv
Copy link
Author

dv commented Jul 9, 2018

I have removed

      <xsl:if test="contains($style, 'bullet')">
        <w:rPr>
          <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
        </w:rPr>
      </xsl:if>

From the numbering.xslt file and that seems to work for us as a workaround.

johnpinto1 added a commit to DMPRoadmap/roadmap that referenced this issue Oct 23, 2019
when viewed in an old Word editor.

The fix follows the solution suggested in  the HtmlToWord bug "List item
bullets corrupted in Microsoft Word"
karnov/htmltoword#73 suggested by David
Verhasselt @dv.

Changes:
   - Firstly, removed earlier attempted fix in commit
     5ef7e05 (Fix for format issues for
     bullet points in Plan docx exports).
   - Made a copy of Htmltoword (1.1.0) xslt stylesheets functions.xslt
     and numbering.xslt and made changes suggested by karnov/htmltoword#73
   - Prepended the Htmltoword library XSLTHelper method xslt_path() in
     config/initializers/htmlto_word_xslt_helper.rb. This method ensures
     the Htmltoword library picks up the changed  numbering.xslt template instead of
     the library's version.

Fix for issue #2147.
johnpinto1 added a commit to DMPRoadmap/roadmap that referenced this issue Nov 1, 2019
when viewed in an old Word editor.

The fix follows the solution suggested in  the HtmlToWord bug "List item
bullets corrupted in Microsoft Word"
karnov/htmltoword#73 suggested by David
Verhasselt @dv.

Changes:
   - Firstly, removed earlier attempted fix in commit
     5ef7e05 (Fix for format issues for
     bullet points in Plan docx exports).
   - Made a copy of Htmltoword (1.1.0) xslt stylesheets functions.xslt
     and numbering.xslt and made changes suggested by karnov/htmltoword#73
   - Prepended the Htmltoword library XSLTHelper method xslt_path() in
     config/initializers/htmlto_word_xslt_helper.rb. This method ensures
     the Htmltoword library picks up the changed  numbering.xslt template instead of
     the library's version.
   - pinned version of htmltoword to 1.1.0

Fix for issue #2147.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant