summaryrefslogtreecommitdiff
path: root/mod/tex/context/third/rst/t-rst.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'mod/tex/context/third/rst/t-rst.mkiv')
-rw-r--r--mod/tex/context/third/rst/t-rst.mkiv12
1 files changed, 11 insertions, 1 deletions
diff --git a/mod/tex/context/third/rst/t-rst.mkiv b/mod/tex/context/third/rst/t-rst.mkiv
index 0a3e25b..bb727b0 100644
--- a/mod/tex/context/third/rst/t-rst.mkiv
+++ b/mod/tex/context/third/rst/t-rst.mkiv
@@ -112,12 +112,22 @@
%D Thus, the user should never supply any of these manually,
%D neither before nor after \type{\typesetRSTfile}.
%D
+%D We now handle rogue utf-8 byte order marks on demand, just set
+%D the optional parameter \type{stripBOM} to {\em true}.
+%D
+%D There also is an option \type{expandtab} to convert tabs
+%D (ascii 0x09) to indents prior to converting reST input. The
+%D expansion width defaults to {\em 4} and can be configured
+%D through the parameter \type{shiftwidth} (takes an integer).
+%D
%D \showsetup{typesetRSTfile}
\def\do_typesetRSTfile[#1]#2{%
\iffirstargument
\getparameters[RST][#1]%
- \doifdefined{\RSTstripBOM}{\ctxlua{thirddata.rst.strip_BOM = "\RSTstripBOM"}}%
+ \doifdefined{RSTstripBOM} {\ctxlua{thirddata.rst.strip_BOM = \RSTstripBOM}}%
+ \doifdefined{RSTexpandtab} {\ctxlua{thirddata.rst.expandtab = \RSTexpandtab}}%
+ \doifdefined{RSTshiftwidth}{\ctxlua{thirddata.rst.shiftwidth = \RSTshiftwidth}}%
\fi
\ctxlua{thirddata.rst.do_rst_file("#2")}%
}