summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-05-02 20:50:59 +0000
committerKarl Berry <karl@freefriends.org>2018-05-02 20:50:59 +0000
commit24994bf3727b2e3aaa26b585177bdfe0a275af8c (patch)
tree1e0a4aa1c549d9aeb1baf73acdba4545cb40c63f /Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
parent0f191996e5297a6d29daa555806f016a691ca723 (diff)
babel (2may18)
git-svn-id: svn://tug.org/texlive/trunk@47576 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua')
-rw-r--r--Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
index ab455dc3d4c..0d66b33ccde 100644
--- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
+++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua
@@ -81,15 +81,22 @@ function Babel.bidi(head, ispar)
for item in node.traverse(head) do
-- three cases: glyph, dir, otherwise
- if item.id == node.id'glyph' then
+ if item.id == node.id'glyph'
+ or (item.id == 7 and item.subtype == 2) then
- local chardata = characters[item.char]
+ local itemchar
+ if item.id == 7 and item.subtype == 2 then
+ itemchar = item.replace.char
+ else
+ itemchar = item.char
+ end
+ local chardata = characters[itemchar]
dir = chardata and chardata.d or nil
if not dir then
for nn, et in ipairs(ranges) do
- if item.char < et[1] then
+ if itemchar < et[1] then
break
- elseif item.char <= et[2] then
+ elseif itemchar <= et[2] then
dir = et[3]
break
end
@@ -100,7 +107,7 @@ function Babel.bidi(head, ispar)
attr_dir = 0
for at in node.traverse(item.attr) do
if at.number == luatexbase.registernumber'bbl@attr@dir' then
- attr_dir = at.value
+ attr_dir = at.value % 3
end
end
if attr_dir == 1 then