From 7aa2b0c21de0f45a4e350893077d706ad678d25b Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Fri, 26 Apr 2019 18:11:44 +0200 Subject: renamed ekdosis.textotei() to local function textotei(). set tei_p_open to true before passing str on to textotei() --- ekdosis.dtx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index 056d13e..e612149 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -998,7 +998,7 @@ local function cmdtotei(str) return str end -function ekdosis.textotei(str) +local function textotei(str) str = xml_entities(str) if tei_p_open then @@ -1040,8 +1040,8 @@ function ekdosis.openteistream() f:write("", "\n") for i = 1,#listWit do f:write('", "\n") - f:write('', ekdosis.textotei(listWit[i].abbr), "", "\n") - f:write(ekdosis.textotei(listWit[i].detailsDesc), "\n") + f:write('', textotei(listWit[i].abbr), "", "\n") + f:write(textotei(listWit[i].detailsDesc), "\n") f:write("", "\n") if listWit[i].msIdentifier.settlement == "" and listWit[i].msIdentifier.repository == "" @@ -1052,16 +1052,16 @@ function ekdosis.openteistream() else f:write("", "\n") if listWit[i].msIdentifier.settlement ~= "" then - f:write("", ekdosis.textotei(listWit[i].msIdentifier.settlement), "", "\n") + f:write("", textotei(listWit[i].msIdentifier.settlement), "", "\n") else end if listWit[i].msIdentifier.repository ~= "" then - f:write("", ekdosis.textotei(listWit[i].msIdentifier.repository), "", "\n") + f:write("", textotei(listWit[i].msIdentifier.repository), "", "\n") else end if listWit[i].msIdentifier.idno ~= "" then - f:write("", ekdosis.textotei(listWit[i].msIdentifier.idno), "", "\n") + f:write("", textotei(listWit[i].msIdentifier.idno), "", "\n") else end if listWit[i].msIdentifier.msName ~= "" then - f:write("", ekdosis.textotei(listWit[i].msIdentifier.msName), "", "\n") + f:write("", textotei(listWit[i].msIdentifier.msName), "", "\n") else end f:write("", "\n") end @@ -1071,16 +1071,16 @@ function ekdosis.openteistream() while listWit[i].handDesc[j] do f:write("", "\n") - -- f:write('

', ekdosis.textotei(listWit[i].handDesc[j].abbr), "

", "\n") + -- f:write('

', textotei(listWit[i].handDesc[j].abbr), "

", "\n") if listWit[i].handDesc[j].handNote == "" then - f:write('', ekdosis.textotei(listWit[i].handDesc[j].abbr), "", "\n") + f:write('', textotei(listWit[i].handDesc[j].abbr), "", "\n") else f:write("", "\n") - f:write('', ekdosis.textotei(listWit[i].handDesc[j].abbr), "", "\n") - f:write("

", ekdosis.textotei(listWit[i].handDesc[j].handNote), "

", "\n") + f:write('', textotei(listWit[i].handDesc[j].abbr), "", "\n") + f:write("

", textotei(listWit[i].handDesc[j].handNote), "

", "\n") f:write("
", "\n") - -- f:write("\n

", ekdosis.textotei(listWit[i].handDesc[j].handNote), "

\n
", "\n") + -- f:write("\n

", textotei(listWit[i].handDesc[j].handNote), "

\n
", "\n") end j = j + 1 f:write("
", "\n") @@ -1090,12 +1090,12 @@ function ekdosis.openteistream() if listWit[i].history ~= nil then f:write("", "\n") f:write("", "\n") - f:write("", ekdosis.textotei(listWit[i].history.origin.origDate), "", "\n") + f:write("", textotei(listWit[i].history.origin.origDate), "", "\n") f:write("", "\n") f:write("", "\n") end -- if listWit[i].detailsDesc == "" then else - -- f:write("

", ekdosis.textotei(listWit[i].detailsDesc), "

", "\n") + -- f:write("

", textotei(listWit[i].detailsDesc), "

", "\n") -- end f:write("
", "\n") f:write("
", "\n") @@ -1159,9 +1159,9 @@ end function ekdosis.exporttei(str) local f = io.open(teifilename.."_tmp.xml", "a+") - str = ekdosis.textotei(str) f:write("\n

") tei_p_open = true + str = textotei(str) f:write(str) if tei_p_open then -- cgit v1.2.3