Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support mammoth options in docx converter #1549

@dparker2

Description

@dparker2

My specific issue is that two adjacent lists end up getting combined together along the process of docx --> html --> markdown.

As in:

1. Item 1
2. Item 2
3. Item 3

1. Item 1
2. Item 2
3. Item 3

in the docx end up converted as:

1. Item 1
2. Item 2
3. Item 3
4. Item 1
5. Item 2
6. Item 3

one way around this is to pass in ignore_empty_paragraphs=False into mammoth.convert_to_html so that the blank line between the lists ends up as <p></p>, which then causes markdownify to separate the lists properly. However, the DocxConverter does not allow for passing any options into mammoth.convert_to_html other than custom style maps.

Possible related issue

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