diff --git a/src/formatting.py b/src/formatting.py index f9a2299..7a24711 100644 --- a/src/formatting.py +++ b/src/formatting.py @@ -138,8 +138,10 @@ def parse_segments(text, sanitize_linequotes=True): pg += "[linequote: %s]" % inner.strip() else: - sep = "\n" if line[0] in punctuation else " " - pg += apply_directives(line.rstrip()) + sep + compiled = apply_directives(line.rstrip()) + split_p = line[0] in punctuation + sep = "\n" if split_p else " " + pg += (sep + compiled) if split_p else (compiled + sep) result.append(pg.rstrip()) return result