diff options
Diffstat (limited to 'ekdosis.dtx')
-rw-r--r-- | ekdosis.dtx | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index 8fd0a15..64122d3 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -948,12 +948,12 @@ Running "make install" installs the files in the local TeX tree. | |||
948 | {\edef\note@contents{% | 948 | {\edef\note@contents{% |
949 | % \hskip .75em | 949 | % \hskip .75em |
950 | \ifekd@mapps | 950 | \ifekd@mapps |
951 | \ifbool{subsq@unit@\ekdan@type}% | 951 | \ifbool{subsq@unit@\ekdan@type}% |
952 | {\ekd@munit@delim}{}% | 952 | {\ekd@munit@delim}{}% |
953 | \else% | 953 | \else% |
954 | \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% | 954 | \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% |
955 | \fi% | 955 | \fi% |
956 | \current@ref@arg{\ekdn@labelb}{\ekdn@labele}%\hskip .25em | 956 | \current@ref@arg{\ekdn@labelb}{\ekdn@labele}%\hskip .25em |
957 | \ifdefined\ekdn@lem% | 957 | \ifdefined\ekdn@lem% |
958 | {\textdir TRT\unexpanded\expandafter{\ekdn@lem}}% | 958 | {\textdir TRT\unexpanded\expandafter{\ekdn@lem}}% |
959 | \unexpanded\expandafter{\ekdn@sep}\else\fi% | 959 | \unexpanded\expandafter{\ekdn@sep}\else\fi% |
@@ -961,10 +961,10 @@ Running "make install" installs the files in the local TeX tree. | |||
961 | {\edef\note@contents{% | 961 | {\edef\note@contents{% |
962 | % \hskip .75em | 962 | % \hskip .75em |
963 | \ifekd@mapps | 963 | \ifekd@mapps |
964 | \ifbool{subsq@unit@\ekdan@type}% | 964 | \ifbool{subsq@unit@\ekdan@type}% |
965 | {\ekd@munit@delim}{}% | 965 | {\ekd@munit@delim}{}% |
966 | \else% | 966 | \else% |
967 | \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% | 967 | \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi% |
968 | \fi% | 968 | \fi% |
969 | \current@ref@arg{\ekdn@labelb}{\ekdn@labele}%\hskip .25em | 969 | \current@ref@arg{\ekdn@labelb}{\ekdn@labele}%\hskip .25em |
970 | \ifdefined\ekdn@lem | 970 | \ifdefined\ekdn@lem |
@@ -1588,7 +1588,7 @@ local function lem_rdg_totei(str) | |||
1588 | arg = string.sub(arg, 2, -2) | 1588 | arg = string.sub(arg, 2, -2) |
1589 | return lem_rdg_totei(string.format("<%s>%s</%s>", cmd, arg, cmd)) | 1589 | return lem_rdg_totei(string.format("<%s>%s</%s>", cmd, arg, cmd)) |
1590 | end) | 1590 | end) |
1591 | -- str = string.gsub(str, "(%<lem.-%>.-)(%<note.-%<%/note%>)(.-%<%/lem%>)", "%1%3%2") | 1591 | -- str = string.gsub(str, "(%<lem.-%>.-)(%<note.-%<%/note%>)(.-%<%/lem%>)", "%1%3%2") |
1592 | return str | 1592 | return str |
1593 | end | 1593 | end |
1594 | 1594 | ||
@@ -1764,6 +1764,23 @@ local function checkpars(str) | |||
1764 | return str | 1764 | return str |
1765 | end | 1765 | end |
1766 | 1766 | ||
1767 | local function self_close_tags(str) | ||
1768 | str = gsub(str, lpeg.P("<" * -lpeg.S("/")) | ||
1769 | * lpeg.Cs(letters^1) | ||
1770 | * lpeg.Cs((1 - lpeg.S"<>")^0) | ||
1771 | * lpeg.P(">") | ||
1772 | * lpeg.P("</") | ||
1773 | * lpeg.Cs(letters^1) | ||
1774 | * lpeg.P(">"), function(ftag, arg, ltag) | ||
1775 | if ftag == ltag | ||
1776 | then | ||
1777 | return string.format("<%s%s/>", ftag, arg) | ||
1778 | else | ||
1779 | end | ||
1780 | end) | ||
1781 | return str | ||
1782 | end | ||
1783 | |||
1767 | local function textotei(str) | 1784 | local function textotei(str) |
1768 | str = xml_entities(str) | 1785 | str = xml_entities(str) |
1769 | str = texpatttotei(str) | 1786 | str = texpatttotei(str) |
@@ -1774,6 +1791,7 @@ local function textotei(str) | |||
1774 | str = versetotei(str) | 1791 | str = versetotei(str) |
1775 | str = envtotei(str) | 1792 | str = envtotei(str) |
1776 | str = cmdtotei(str) | 1793 | str = cmdtotei(str) |
1794 | str = self_close_tags(str) | ||
1777 | str = partotei(str) | 1795 | str = partotei(str) |
1778 | str = checkpars(str) | 1796 | str = checkpars(str) |
1779 | return str | 1797 | return str |