From 541c35d0217ae18d734252448015ef6d5ed9a745 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Mon, 30 Aug 2021 18:44:22 +0200
Subject: new hook siglumsep

---
 ekdosis.dtx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 7ff76a2..2be331a 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -7757,6 +7757,7 @@ Sample text with a \textcolor{red}{word} in red.
   store appfontsize = \ekd@appfontsize,
   store refnumstyle = \ekd@refnumstyle,
   store postrefnum = \ekd@postrefnum,
+  code siglumsep = \luadirect{ekdosis.setsiglumsep(\luastringN{#1})},
   store lemmastyle = \ekd@lemmastyle,
   store readingstyle = \ekd@readingstyle,
   code keyparopts = \if@pkg@keyfloat\ekd@keyparopts{#1}\fi,
@@ -10367,6 +10368,18 @@ function ekdosis.newsource(id, siglum)
    return true
 end
 
+local siglumsep = nil
+
+function ekdosis.setsiglumsep(str)
+   if str == "reset"
+   then
+      siglumsep = nil
+   else
+      siglumsep = str
+   end
+   return true
+end
+
 function ekdosis.getsiglum(str, opt)
    str = str..","
    str = string.gsub(str, "%s-(%,)", "%1")
@@ -10388,6 +10401,10 @@ function ekdosis.getsiglum(str, opt)
       for i = 1,#idsRend do
 	 local tempc = string.gsub(idsRend[i].xmlid, "([%-%.%_])", "%%%1")
 	 str  = string.gsub(str, tempc.."%,", idsRend[i].abbr)
+	 if siglumsep ~= nil
+	 then
+	    str = string.gsub(str, "%s", siglumsep)
+	 end
 	 ctrl = string.gsub(ctrl, tempc.."%,", "")
       end
    end
-- 
cgit v1.2.3

