Skip to content

List item bullets corrupted in Microsoft Word #73

@dv

Description

@dv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions