From 69e14a448f99226dd21485bdc61108ab97126323 Mon Sep 17 00:00:00 2001
From: Robert Alessi
") + * lpeg.Cs(envtotags[i].a) * lpeg.P("}" * spcenc^-1 * lpeg.P("\\par")), + ""..envtotags[i].b..">\n
") + str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") + * lpeg.Cs(envtotags[i].a) * lpeg.P("}"), + ""..envtotags[i].b..">") else str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}") @@ -1723,22 +1732,32 @@ local function cmdtotei(str) return str end +local function partotei(str) + str = string.gsub(str, "\\par%s-", "
", 1) + str = string.gsub(str, "\\par%s-", "
") + str = string.gsub(str, "
%s-
", "") + str = string.gsub(str, "(%)%s-(%)$", "%2") + str = string.gsub(str, "(%
)%s-$", "") + return str +end + local function textotei(str) str = xml_entities(str) str = texpatttotei(str) - if tei_p_open - then - str = string.gsub(str, "%s?\\par%s?", "
\n") - else - str = string.gsub(str, "%s?\\par%s?", "\n
") - tei_p_open = true - end + -- if tei_p_open + -- then + -- str = string.gsub(str, "%s?\\par%s?", "
\n") + -- else + -- str = string.gsub(str, "%s?\\par%s?", "\n
") + -- tei_p_open = true + -- end str = note_totei(str) str = app_totei(str) str = lem_rdg_totei(str) str = versetotei(str) str = envtotei(str) str = cmdtotei(str) + str = partotei(str) return str end @@ -1879,16 +1898,16 @@ end function ekdosis.exporttei(str) local f = io.open(teifilename.."_tmp.xml", "a+") - f:write("\n
") - tei_p_open = true + -- f:write("\n
") + -- tei_p_open = true str = textotei(str) f:write(str) - if tei_p_open - then - f:write("
") - tei_p_open = false - else - end + -- if tei_p_open + -- then + -- f:write("") + -- tei_p_open = false + -- else + -- end f:close() return true end -- cgit v1.2.3