From ab0a580b61ae53c4d22cb93fd52006cb102b92e9 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 20 Aug 2011 22:35:49 +0200 Subject: optional tab as indent handling; fixed missing blank line at eof bug --- mod/tex/context/third/rst/t-rst.mkiv | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mod/tex/context/third/rst/t-rst.mkiv') 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")}% } -- cgit v1.2.3