mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-29 20:18:37 +01:00
Add explanatory comments
Also, remove line which was accidentally removed
This commit is contained in:
parent
cdc06a8bf1
commit
99106bb6fe
|
|
@ -76,6 +76,11 @@ def main(input_module, file_stream=None, out_dir=None, verbose=False):
|
|||
return " "*indent + input
|
||||
|
||||
def wrap(input, wrap=80, initial_indent=""):
|
||||
if len(input) == 0:
|
||||
return initial_indent
|
||||
# TextWrapper collapses newlines into single spaces; we do our own
|
||||
# splitting on newlines to prevent this, so that newlines can actually
|
||||
# be intentionally inserted in text.
|
||||
input_lines = input.split('\n\n')
|
||||
wrapper = TextWrapper(initial_indent=initial_indent, width=wrap)
|
||||
output_lines = [wrapper.fill(line) for line in input_lines]
|
||||
|
|
|
|||
Loading…
Reference in a new issue