From 8976e160e584d67178ab14ee2110429a99623223 Mon Sep 17 00:00:00 2001
From: Robert Alessi ")) * spcenc^-1 * lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{")
+ if envtotags[i].b == "p"
+ then
+ str = gsub(str, (lpeg.P("\\par") + lpeg.P(" ")) * spcenc^-1 * lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{")
+ * lpeg.Cs(envtotags[i].a) * lpeg.P("}")
+ * bsqbracketsii * bcbracesii * spcenc^-1,
+ "\n<"..envtotags[i].b..envtotags[i].c..">")
+ else
+ str = gsub(str, (lpeg.P("\\par") + lpeg.P(" ")) * spcenc^-1 * lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{")
+ * lpeg.Cs(envtotags[i].a) * lpeg.P("}")
+ * bsqbracketsii * bcbracesii * spcenc^-1,
+ "
") + str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}") * bsqbracketsii * bcbracesii * spcenc^-1, - "\n<"..envtotags[i].b..envtotags[i].c..">") + "<"..envtotags[i].b..envtotags[i].c..">") + str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") + * lpeg.Cs(envtotags[i].a) * lpeg.P("}"), + ""..envtotags[i].b..">\n
") else - str = gsub(str, (lpeg.P("\\par") + lpeg.P("
")) * spcenc^-1 * lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") + str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}") * bsqbracketsii * bcbracesii * spcenc^-1, - "
\n<"..envtotags[i].b..envtotags[i].c..">") + "<"..envtotags[i].b..envtotags[i].c..">") + str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") + * lpeg.Cs(envtotags[i].a) * lpeg.P("}"), + ""..envtotags[i].b..">") end - str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") - * lpeg.Cs(envtotags[i].a) * lpeg.P("}") * spcenc^-1 * (lpeg.P("\\par") + lpeg.P("")), - ""..envtotags[i].b..">\n") - str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") - * lpeg.Cs(envtotags[i].a) * lpeg.P("}") - * bsqbracketsii * bcbracesii * spcenc^-1, - "<"..envtotags[i].b..envtotags[i].c..">") - str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") - * lpeg.Cs(envtotags[i].a) * lpeg.P("}"), - ""..envtotags[i].b..">\n
") else - end - end - for i = 1,#envtotags - do - if envtotags[i].b ~= "" and not isfound(close_p, envtotags[i].b) - then - str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") - * lpeg.Cs(envtotags[i].a) * lpeg.P("}") - * bsqbracketsii * bcbracesii * spcenc^-1, - "<"..envtotags[i].b..envtotags[i].c..">") - str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") - * lpeg.Cs(envtotags[i].a) * lpeg.P("}"), - ""..envtotags[i].b..">") - else - end - end - for i = 1,#envtotags - do - if envtotags[i].b == "" - then str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}") * bsqbracketsii * bcbracesii * spcenc^-1, @@ -1682,7 +1673,6 @@ local function envtotei(str) str = gsub(str, spcenc^-1 * lpeg.P("\\end") * spcenc^-1 * lpeg.P("{") * lpeg.Cs(envtotags[i].a) * lpeg.P("}"), "") - else end end str = gsub(str, lpeg.P("\\begin") * spcenc^-1 * lpeg.P("{") -- cgit v1.2.3