X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/807df526faddb8682eb20cd0a61b39d18a84ff85..2c73c162844627d26991915fecc7e39f02bc34b8:/librarian/text.py?ds=sidebyside diff --git a/librarian/text.py b/librarian/text.py index 9a4fd7a..0f3c0bb 100644 --- a/librarian/text.py +++ b/librarian/text.py @@ -45,6 +45,8 @@ def transform(wldoc, flags=None, **options): if flags: for flag in flags: document.edoc.getroot().set(flag, 'yes') + if 'wrapping' in options: + options['wrapping'] = str(options['wrapping']) result = document.transform(style, **options) @@ -82,7 +84,7 @@ def transform(wldoc, flags=None, **options): source = "" contributors = "" funders = "" - return OutputFile.from_string((TEMPLATE % { + result = (TEMPLATE % { 'description': description, 'url': url, 'license_description': license_description, @@ -90,7 +92,8 @@ def transform(wldoc, flags=None, **options): 'source': source, 'contributors': contributors, 'funders': funders, - }).encode('utf-8')) + }).encode('utf-8') else: - return OutputFile.from_string(unicode(result).encode('utf-8')) + result = unicode(result).encode('utf-8') + return OutputFile.from_string("\r\n".join(result.splitlines()) + "\r\n")