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 | 29 |
1 files changed, 19 insertions, 10 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 2f80775609e..fab6721456a 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 @@ -33,8 +33,6 @@ -- Babel = Babel or {} -Babel.langdirs = {} - require('babel-bidi.lua') local characters = Babel.characters @@ -53,11 +51,10 @@ local function dir_mark(head, from, to, outer) end function Babel.pre_otfload(head) - local first_n, last_n = nil, nil -- first and last char with nums - local last_es = nil -- an auxiliary 'last' used with nums - local first_d, last_d = nil, nil -- first and last char in L/R block - local dir = nil - local dir_real = nil + local first_n, last_n -- first and last char with nums + local last_es -- an auxiliary 'last' used with nums + local first_d, last_d -- first and last char in L/R block + local dir, dir_real local strong = ('TRT' == tex.pardir) and 'r' or 'l' local strong_lr = (strong == 'l') and 'l' or 'r' local outer = strong @@ -65,7 +62,7 @@ function Babel.pre_otfload(head) local new_dir = false local first_dir = false - local last_lr = nil + local last_lr local type_n = '' @@ -88,7 +85,20 @@ function Babel.pre_otfload(head) end dir = dir or 'l' if new_dir then - strong = Babel.langdirs[item.lang] or 'l' + attr_dir = 0 + for at in node.traverse(item.attr) do + if at.number == luatexbase.registernumber'bbl@attr@dir' then + attr_dir = at.value + end + end + texio.write_nl(attr_dir) + if attr_dir == 1 then + strong = 'r' + elseif attr_dir == 2 then + strong = 'al' + else + strong = 'l' + end strong_lr = (strong == 'l') and 'l' or 'r' outer = strong_lr new_dir = false @@ -151,7 +161,6 @@ function Babel.pre_otfload(head) ch.char = characters[ch.char].m or ch.char end end - --last_lr = nil end end if dir == 'l' or dir == 'r' then |