From 3b13f7ac20875df55e02d5e407c4c3cbab3f159c Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 29 Oct 2019 19:50:18 +0300 Subject: . --- src/lines.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/lines.cpp') diff --git a/src/lines.cpp b/src/lines.cpp index 05a75e4..f77ae40 100644 --- a/src/lines.cpp +++ b/src/lines.cpp @@ -2,15 +2,18 @@ TexoProducerLines::TexoProducerLines(TexoExporter &exporter): - TexoProducer(exporter) + TexoProducer(exporter), newline(false) {} void TexoProducerLines::Put(const Texo &piece) { if (piece.c == '\n') { - exporter.Put(' '); + if (!newline) { + exporter.Put(' '); + } } else { exporter.Put(piece.c); + newline = false; } } @@ -18,6 +21,7 @@ void TexoProducerLines::Put(const TexoParagraph &piece) { if (piece.closing) { exporter.Put('\n'); + newline = true; } } @@ -25,6 +29,7 @@ void TexoProducerLines::Put(const TexoQuote &piece) { if (piece.closing) { exporter.Put('\n'); + newline = true; } else { exporter.Put('>'); } @@ -33,6 +38,7 @@ void TexoProducerLines::Put(const TexoQuote &piece) void TexoProducerLines::Put(const TexoLineBreak &piece) { exporter.Put('\n'); + newline = true; } -- cgit v1.2.3