Split on double-newlines not single

Otherwise all sorts of tables get horribly broken
This commit is contained in:
Daniel Wagner-Hall 2015-09-10 13:20:04 +01:00
parent 55f33736b2
commit f67e27e843

View file

@ -76,12 +76,10 @@ def main(input_module, file_stream=None, out_dir=None, verbose=False):
return " "*indent + input return " "*indent + input
def wrap(input, wrap=80, initial_indent=""): def wrap(input, wrap=80, initial_indent=""):
if len(input) == 0: input_lines = input.split('\n\n')
return initial_indent
input_lines = input.split('\n')
wrapper = TextWrapper(initial_indent=initial_indent, width=wrap) wrapper = TextWrapper(initial_indent=initial_indent, width=wrap)
output_lines = [wrapper.fill(line) for line in input_lines] output_lines = [wrapper.fill(line) for line in input_lines]
return '\n'.join(output_lines) return '\n\n'.join(output_lines)
# make Jinja aware of the templates and filters # make Jinja aware of the templates and filters
env = Environment( env = Environment(