diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-01-08 18:01:44 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-01-08 18:01:44 +0000 |
| commit | 78d5cca66ca8f204d5db1aff81519c142705add9 (patch) | |
| tree | 441137c92cecb64833b8ae05800e7799d914eebd /mammoth/__init__.py | |
| parent | d79153e4cc40ccd13d78cfdc463b55ce6913d221 (diff) | |
Add transform_document argument to convert_to_html
Diffstat (limited to 'mammoth/__init__.py')
| -rw-r--r-- | mammoth/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mammoth/__init__.py b/mammoth/__init__.py index 90ab764..59e349f 100644 --- a/mammoth/__init__.py +++ b/mammoth/__init__.py @@ -2,8 +2,10 @@ from .results import Result from . import docx, conversion, options -def convert_to_html(fileobj, **kwargs): - return docx.read(fileobj).bind(lambda document: +def convert_to_html(fileobj, transform_document=None, **kwargs): + if transform_document is None: + transform_document = lambda x: x + return docx.read(fileobj).map(transform_document).bind(lambda document: conversion.convert_document_element_to_html( document, **options.read_options(kwargs) |
