From 88b5ca9599c22894ad5b3a26099108a1caf48af9 Mon Sep 17 00:00:00 2001
From: Wuzzy <almikes@aol.com>
Date: Mon, 12 Dec 2016 22:56:15 +0100
Subject: Avoid double newline for custom factoids

---
 init.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/init.lua b/init.lua
index 3facfea..10e3b82 100644
--- a/init.lua
+++ b/init.lua
@@ -271,7 +271,9 @@ local get_custom_factoids = function(category_id, factoid_type, data)
 	for i=1,#ftable do
 		if factoid_type == nil or ftable[i].ftype == factoid_type then
 			datastring = datastring .. ftable[i].fgen(data.itemstring, data.def)
-			datastring = newline(datastring)
+			if datastring ~= "" then
+				datastring = newline(datastring)
+			end
 		end
 	end
 	return datastring
-- 
cgit v1.2.3