diff options
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/writer.c b/src/writer.c index b682f6a8..60746c0a 100644 --- a/src/writer.c +++ b/src/writer.c @@ -474,16 +474,20 @@ uri_sink(const void* buf, size_t size, size_t nmemb, void* stream) static void write_newline(SerdWriter* writer) { - sink("\n", 1, writer); - for (int i = 0; i < writer->indent; ++i) { - sink("\t", 1, writer); + if (writer->flags & SERD_WRITE_TERSE) { + sink(" ", 1, writer); + } else { + sink("\n", 1, writer); + for (int i = 0; i < writer->indent; ++i) { + sink("\t", 1, writer); + } } } static void write_top_level_sep(SerdWriter* writer) { - if (!writer->empty) { + if (!writer->empty && !(writer->flags & SERD_WRITE_TERSE)) { write_newline(writer); } } |