diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-05 17:19:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-06-05 17:19:50 +0200 |
commit | 7a761c8aebf67ee022aa4857247518ad6997d5c1 (patch) | |
tree | 3295b12a1cc69ea5c61bce9c7c71172831f89d28 /tex/context/base/mkiv/lang-dis.lua | |
parent | 2bca80bc96d0182956e57c51b5d4977f714bed5c (diff) | |
download | context-7a761c8aebf67ee022aa4857247518ad6997d5c1.tar.gz |
2016-06-05 16:31:00
Diffstat (limited to 'tex/context/base/mkiv/lang-dis.lua')
-rw-r--r-- | tex/context/base/mkiv/lang-dis.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/lang-dis.lua b/tex/context/base/mkiv/lang-dis.lua index 749e2e35d..7fd5a6afb 100644 --- a/tex/context/base/mkiv/lang-dis.lua +++ b/tex/context/base/mkiv/lang-dis.lua @@ -26,6 +26,7 @@ local getattr = nuts.getattr local getsubtype = nuts.getsubtype local setsubtype = nuts.setsubtype local getchar = nuts.getchar +local setchar = nuts.setchar local getdisc = nuts.getdisc local setdisc = nuts.setdisc local isglyph = nuts.isglyph @@ -33,12 +34,14 @@ local isglyph = nuts.isglyph local copy_node = nuts.copy local remove_node = nuts.remove local traverse_id = nuts.traverse_id +local flush_list = nuts.flush_list local nodecodes = nodes.nodecodes local disccodes = nodes.disccodes local disc_code = nodecodes.disc local glyph_code = nodecodes.glyph + local discretionary_code = disccodes.discretionary local a_visualize = attributes.private("visualizediscretionary") @@ -49,7 +52,7 @@ local getlanguagedata = languages.getdata local check_regular = true local expanders = { - [disccodes.discretionary] = function(d,template) + [discretionary_code] = function(d,template) -- \discretionary return template end, @@ -61,18 +64,23 @@ local expanders = { local char = isglyph(pre) if char and char <= 0 then done = true - pre = nil + flush_list(pre) + pre = nil end end if post then local char = isglyph(post) if char and char <= 0 then done = true + flush_list(post) post = nil end end if done then + -- todo: take existing penalty setdisc(d,pre,post,replace,discretionary_code,tex.exhyphenpenalty) + else + setfield(d,"subtype",discretionary_code) end return template end, |