md_build_attribute: Propagate NULL string if attribute is empty.
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 3c1f746..e0f5ffe 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -1435,7 +1435,7 @@ md_build_attribute(MD_CTX* ctx, const CHAR* raw_text, SZ raw_size,
}
if(is_trivial) {
- build->text = (CHAR*) raw_text;
+ build->text = (CHAR*) (raw_size ? raw_text : NULL);
build->substr_types = build->trivial_types;
build->substr_offsets = build->trivial_offsets;
build->substr_count = 1;