diff options
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.lua | 17 |
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 |