aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/writer.c2
-rw-r--r--test/extra/pretty/named-graph.trig16
3 files changed, 16 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index fe1cbf83..372e20fe 100644
--- a/NEWS
+++ b/NEWS
@@ -6,8 +6,9 @@ serd (0.32.3) unstable; urgency=medium
* Gracefully handle errors while writing the end of anonymous nodes
* Support reading lone lists in lax mode
* Treat out of range unicode characters as errors
+ * Write blank lines between graphs and statements in TriG
- -- David Robillard <d@drobilla.net> Sun, 23 Jun 2024 19:02:38 +0000
+ -- David Robillard <d@drobilla.net> Mon, 24 Jun 2024 14:01:08 +0000
serd (0.32.2) stable; urgency=medium
diff --git a/src/writer.c b/src/writer.c
index 2b127d04..c0f1a4a7 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -987,8 +987,8 @@ serd_writer_write_statement(SerdWriter* writer,
(!graph && writer->context.graph.type)) {
TRY(st, terminate_context(writer));
reset_context(writer, RESET_GRAPH | RESET_INDENT);
+ TRY(st, write_newline(writer));
if (graph) {
- TRY(st, write_newline(writer));
TRY(st, write_node(writer, graph, datatype, lang, FIELD_GRAPH, flags));
TRY(st, write_sep(writer, SEP_GRAPH_BEGIN));
copy_node(&writer->context.graph, graph);
diff --git a/test/extra/pretty/named-graph.trig b/test/extra/pretty/named-graph.trig
index 5cd12f3b..29f1d970 100644
--- a/test/extra/pretty/named-graph.trig
+++ b/test/extra/pretty/named-graph.trig
@@ -1,8 +1,18 @@
@prefix eg: <http://example.org/> .
-eg:g {
- eg:s
- eg:p [
+eg:g1 {
+ eg:s1
+ eg:p1 [
a eg:Object
] .
}
+
+eg:g2 {
+ eg:s2
+ eg:p2 [
+ a eg:Object
+ ] .
+}
+
+eg:s3
+ eg:p3 eg:o3 .