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/rst_context.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mod/tex/context/third/rst/rst_context.lua') diff --git a/mod/tex/context/third/rst/rst_context.lua b/mod/tex/context/third/rst/rst_context.lua index 5d35906..d2fb002 100644 --- a/mod/tex/context/third/rst/rst_context.lua +++ b/mod/tex/context/third/rst/rst_context.lua @@ -118,9 +118,7 @@ function rst_context.strong_emphasis (str) end function rst_context.literal (str) - str = str:gsub([[\]], [[\\]]) -- evade escaping of backslashes return [[\\type{]] .. str .. [[}]] - --return [[\\starttyping ]] .. str .. [[\\stoptyping]] end --- ROLES for interpreted text @@ -336,11 +334,15 @@ do end local p_escape = P{ - [1] = Cs((V"skip" + chars + 1)^1), + [1] = Cs((V"skip" + --+ V"literal" -- achieved via gsub later + + chars + + 1)^1), skip1 = P"\\starttyping" * (1 - P"\\stoptyping")^1, balanced = P"{" * (V"balanced" + (1 - P"}"))^0 * P"}", skip2 = P"\\type" * V"balanced", skip = V"skip1" + V"skip2", + --literal = Cs(P"\\" / "") * 1 } function rst_context.escape (str) -- cgit v1.2.3