aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2021-04-06 09:07:32 +0200
committerRobert Alessi <alessi@robertalessi.net>2021-04-06 09:07:32 +0200
commite5d27c17c5920c6b8f78eff920f5f25c7a1b8a66 (patch)
tree3bec511beb6bab4d9c71ffbb678c6bb5ab6309b4
parentd885811c0fc0c53ba45df33d3076126a31c618c6 (diff)
downloadekdosis-e5d27c17c5920c6b8f78eff920f5f25c7a1b8a66.tar.gz
relocate_notes() operated outside <lem> in some instances: corrected
-rw-r--r--ekdosis.dtx12
1 files changed, 11 insertions, 1 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index ff9d2f9..3e2e6ed 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -9087,6 +9087,7 @@ local cmdargs = lpeg.Cs(spce^-1 * bsqbracketsii * bcbracesii * bsqbrackets^-1)
9087local app = lpeg.Cs("app") 9087local app = lpeg.Cs("app")
9088local lemrdg = lpeg.Cs(lpeg.Cs("lem") + lpeg.Cs("rdg")) 9088local lemrdg = lpeg.Cs(lpeg.Cs("lem") + lpeg.Cs("rdg"))
9089local note = lpeg.Cs("note") 9089local note = lpeg.Cs("note")
9090local inlem = lpeg.Cs{ "<lem" * ((1 - (lpeg.P"<lem" + lpeg.P"</lem>")) + lpeg.V(1))^0 * "</lem>" }
9090local lnbrk = lpeg.Cs("\\\\") 9091local lnbrk = lpeg.Cs("\\\\")
9091local poemline = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.S("*!")^-1 * bsqbrackets^-1 * spcenc^-1) 9092local poemline = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.S("*!")^-1 * bsqbrackets^-1 * spcenc^-1)
9092local poemlinebreak = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.P("&gt;") * bsqbrackets^-1 * spcenc^-1) 9093local poemlinebreak = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.P("&gt;") * bsqbrackets^-1 * spcenc^-1)
@@ -9683,7 +9684,16 @@ local function lem_rdg_totei(str)
9683end 9684end
9684 9685
9685local function relocate_notes(str) 9686local function relocate_notes(str)
9686 str = string.gsub(str, "(%<lem.-%>.-)(%<note.->.-%<%/note%>)(.-%<%/lem%>)", "%1%3%2") 9687 str = gsub(str, inlem, function(arg)
9688 local notes = {}
9689 for i in string.gmatch(arg, "%<note.->.-%<%/note%>")
9690 do
9691 table.insert(notes, i)
9692 end
9693 allnotes = table.concat(notes)
9694 arg = string.gsub(arg, "%<note.->.-%<%/note%>", "")
9695 return string.format("%s%s", arg, allnotes)
9696 end)
9687 return str 9697 return str
9688end 9698end
9689 9699