diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua index a6f6849e7c9..81f88aa84be 100644 --- a/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua +++ b/Master/texmf-dist/tex/generic/babel/babel-bidi-basic.lua @@ -7,7 +7,7 @@ -- babel.dtx (with options: `basic') -- -- --- Copyright (C) 2012-2024 Javier Bezos and Johannes L. Braams. +-- Copyright (C) 2012-2025 Javier Bezos and Johannes L. Braams. -- Copyright (C) 1989-2012 Johannes L. Braams and -- any individual authors listed elsewhere in this file. -- All rights reserved. @@ -444,9 +444,7 @@ function Babel.bidi(head, ispar, hdir) end head = node.prev(head) or head - - -------------- FIX HYPERLINKS ---------------- - + --- FIXES --- if has_hyperlink then local flag, linking = 0, 0 for item in node.traverse(head) do @@ -473,10 +471,23 @@ function Babel.bidi(head, ispar, hdir) end end + for item in node.traverse_id(10, head) do + local p = item + local flag = false + while p.prev and p.prev.id == 14 do + flag = true + p = p.prev + end + if flag then + node.insert_before(head, p, node.copy(item)) + node.remove(head,item) + end + end + return head end -- Make sure anything is marked as 'bidi done' (including nodes inserted --- after the babel algorithm). +-- after the babel algorithm). 128 = 1000 0000. function Babel.unset_atdir(head) local ATDIR = Babel.attr_dir for item in node.traverse(head) do |