Skip to content

Fail convert if "convert_to" consists of three parts #27

@arnisoft

Description

@arnisoft

To convert a document to HTML with embdedded images, you must use convert_to param 'html:HTML:EmbedImages'.
For example:
Libreconv.convert('document.docx', '/Users/ricn/pdf_documents/my_document_as.html', nil, 'html:HTML:EmbedImages')

But this code fail at

target_tmp_file = File.join(
          target_path,
          File.basename(@escaped_source_path, '.*') + '.' +
            File.basename(@convert_to, ':*')
        )

because generating output filename extension File.basename(@convert_to, ':*') returns 'html:HTML'.
This is incorrect filename extension.

I think code
File.basename(@convert_to, ':*')
must be replaced by something like this
@convert_to.split(':').first

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