aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/writer.c b/src/writer.c
index a0206578..a12f39b9 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -413,16 +413,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);
}
}