From 51e71a7c358c9ab7979816718e30e75532585b4b Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Thu, 17 Jun 2021 08:19:10 +0200 Subject: ekdosis.getsiglum() did not process dots, hyphens and underscores properly --- ekdosis.dtx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index 48d8551..01d9b60 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -5329,6 +5329,7 @@ subtype="arabtex">'inna 'abI kAna mina % \paragraph{Conditional page breaks} % \phts\label{ref:ekdpb} \DescribeMacro{\ekdpb}\DescribeMacro{\ekdpb*} % \cs{ekdpb}\oarg{page no}\marg{line no} +% \cs{ekdpb*}|{}| \cs{ekdpb*}|\| % \newfeature[v1.2]\\ % One way to avoid this inconvenience is to use \cs{ekdpb} instead of % the standard \cs{pagebreak} command provided by \LaTeX\ to insert @@ -9801,19 +9802,22 @@ function ekdosis.getsiglum(str, opt) ctrl = str if opt == "tei" then for i = 1,#shorthands do - str = string.gsub(str, shorthands[i].a, shorthands[i].c) + local tempa = string.gsub(shorthands[i].a, "([%-%.%_])", "%%%1") + str = string.gsub(str, tempa, shorthands[i].c) end for i = 1,#idsRend do - str = string.gsub(str, "(%f[%w%.%-%_])"..idsRend[i].xmlid.."(%,)", + local tempb = string.gsub(idsRend[i].xmlid, "([%-%.%_])", "%%%1") + str = string.gsub(str, "(%f[%w%-%.%_])"..tempb.."(%,)", "%1#"..idsRend[i].xmlid.."%2") - ctrl = string.gsub(ctrl, idsRend[i].xmlid.."%,", "") + ctrl = string.gsub(ctrl, tempb.."%,", "") end str = string.gsub(str, "%,(%s-)([%#])", " %2") str = string.gsub(str, "%,$", "") else for i = 1,#idsRend do - str = string.gsub(str, idsRend[i].xmlid.."%,", idsRend[i].abbr) - ctrl = string.gsub(ctrl, idsRend[i].xmlid.."%,", "") + local tempc = string.gsub(idsRend[i].xmlid, "([%-%.%_])", "%%%1") + str = string.gsub(str, tempc.."%,", idsRend[i].abbr) + ctrl = string.gsub(ctrl, tempc.."%,", "") end end -- if string.find(ctrl, "[A-Za-z0-9]") -- cgit v1.2.3