diff options
author | Hans Hagen <pragma@wxs.nl> | 2012-12-24 20:08:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2012-12-24 20:08:00 +0100 |
commit | 5f48570bba149ac17f45c80d5ee95306aa69d0c9 (patch) | |
tree | bfd405cdf69acd82e4352f142f3b0220abde6ed5 /tex/context/base/char-tex.lua | |
parent | d2d2f5a76a2323d1adafe3dc1926e95064b206d9 (diff) | |
download | context-5f48570bba149ac17f45c80d5ee95306aa69d0c9.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) |