From d275bb566ac22f1fee8b6a566a0b5bd47cecdd56 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 5 May 2011 00:10:35 +0200 Subject: revisited module code --- mod/tex/context/third/rst/t-rst.mkiv | 53 ++++++++++-------------------------- 1 file changed, 15 insertions(+), 38 deletions(-) (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 e047775..a64a0d1 100644 --- a/mod/tex/context/third/rst/t-rst.mkiv +++ b/mod/tex/context/third/rst/t-rst.mkiv @@ -69,55 +69,32 @@ %D The environment \type{\[start|stop]RST} and the macro %D \type{\RST} allow access to reST-parser from inside a %D \CONTEXT-document when the module is loaded. -\unexpanded\def\startRST{% - \setcatcodetable \RST_catcodes% + +% Wolfgang’s code below. +\unexpanded \def \startRST{% + \begingroup + \setcatcodetable \RST_catcodes \do_start_RST% } -\let\stopRST\relax +\let \stopRST \relax -\def\do_start_RST#1\stopRST{% - \edef\RST_data{#1}% - \setcatcodetable \ctxcatcodes% - \ctxlua{thirddata.rst.do_rst_snippet([[\RST_data]])}% +\def \do_start_RST#1\stopRST{% + \endgroup% + \ctxlua{thirddata.rst.do_rst_snippet(\!!bs#1\!!es)}% } -\def\RST{% - \setcatcodetable \RST_catcodes% +\def \RST{% + \begingroup + \setcatcodetable \RST_catcodes \do_RST% } -\def\do_RST#1{% - \def\RST_data{#1}% - \setcatcodetable \ctxcatcodes% - \ctxlua{thirddata.rst.do_rst_snippet([[\RST_data]])}% +\def \do_RST#1{% + \endgroup% + \ctxlua{thirddata.rst.do_rst_snippet(\!!bs#1\!!es)}% } -%%% Wolfgang’s code below; needs testing -%\unexpanded\def\startRST{% - %\begingroup - %\setcatcodetable \RST_catcodes - %\dostartRST% -%} - -%\let\stopRST\relax - -%\def\dostartRST#1\stopRST{% - %\ctxlua{thirddata.rst.do_rst_snippet(\!!bs#1\!!es)}% - %\endgroup% -%} - -%\def\RST{% - %\begingroup - %\setcatcodetable \RST_catcodes - %\doRST% -%} - -%\def\doRST#1{% - %\ctxlua{thirddata.rst.do_rst_snippet(\!!bs#1\!!es)}% - %\endgroup% -%} - \protect \endinput % vim:ft=context:sw=2:ts=2 -- cgit v1.2.3