summaryrefslogtreecommitdiff
path: root/tex/context/third
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/third')
-rw-r--r--tex/context/third/transliterator/trans_tables_sr.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/tex/context/third/transliterator/trans_tables_sr.lua b/tex/context/third/transliterator/trans_tables_sr.lua
index 9abe5b2..84319b0 100644
--- a/tex/context/third/transliterator/trans_tables_sr.lua
+++ b/tex/context/third/transliterator/trans_tables_sr.lua
@@ -100,14 +100,16 @@ end
local t = translit
local function sr (mode, text)
- local P, R, S, V, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs
+ local P, R, Cs = lpeg.P, lpeg.R, lpeg.Cs
local utfchar = translit.utfchar
- local trl_sr = translit.make_add_dict{}
- trl_sr = t[mode.."_upper"] + t[mode.."_lower"]
+ local trl_sr = translit.make_add_dict{}
+ trl_sr = t[mode.."_upper"] + t[mode.."_lower"]
- local _p_sr = translit.addrules (trl_sr, _p_sr)
- local p_sr = Cs((_p_sr / trl_sr + utfchar)^0)
+ -- transliteration from latin script requires macro handling …
+ local _p_macro = P[[\]] * R("az", "AZ")^1
+ local _p_sr = translit.addrules (trl_sr, _p_sr)
+ local p_sr = Cs((_p_macro + (_p_sr / trl_sr) + utfchar)^0)
return p_sr:match(text)
end