diff options
author | Marius <mariausol@gmail.com> | 2012-12-24 21:40:31 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-12-24 21:40:31 +0200 |
commit | 31c8bf0930a6d3e353a552d6bab71f62bc25f34e (patch) | |
tree | f9fd41e91d4751cdddd2bdfc15ae69f78b61f73f /tex/context/base/char-tex.lua | |
parent | 1c36d2cc9c25d74a806ee74c0ee28da32d5e84ba (diff) | |
download | context-31c8bf0930a6d3e353a552d6bab71f62bc25f34e.tar.gz |
beta 2012.12.24 20:08
Diffstat (limited to 'tex/context/base/char-tex.lua')
-rw-r--r-- | tex/context/base/char-tex.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tex/context/base/char-tex.lua b/tex/context/base/char-tex.lua index e6d6c41e0..91aa387b9 100644 --- a/tex/context/base/char-tex.lua +++ b/tex/context/base/char-tex.lua @@ -189,14 +189,13 @@ local convert_accents_strip = Cs((no_l * accents * no_r + accents + P(1))^0) local convert_commands_strip = Cs((no_l * commands * no_r + commands + P(1))^0) function characters.tex.toutf(str,strip) - if find(str,"\\") then -- we can start at the found position - if strip then - return lpegmatch(convert_accents_strip,lpegmatch(convert_commands_strip,str)) - else - return lpegmatch(convert_accents, lpegmatch(convert_commands, str)) - end + if not find(str,"\\") then -- we can start at the found position + return str + elseif strip then + return lpegmatch(convert_accents_strip,lpegmatch(convert_commands_strip,str)) + else + return lpegmatch(convert_accents, lpegmatch(convert_commands, str)) end - return str end --~ print(characters.tex.toutf([[\"{e}]]),true) |