X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/e57b146bf49e38b3bb57615110b27de5b4d1ae69..a4d6831b455ed69b196905427600d7163cdd3fe8:/librarian/text.py?ds=inline 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")