diff options
author | Norbert Preining <norbert@preining.info> | 2023-04-26 03:02:07 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-04-26 03:02:07 +0000 |
commit | 1ea4eef62d24f4f0574afba646c635f677eeb7cc (patch) | |
tree | 63fbd204a87d79c6fdbccb59221df6581c863ddf /macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx | |
parent | 800f3919ea46f82dc11cbfb51f08d2f3a1c43a70 (diff) |
CTAN sync 202304260302
Diffstat (limited to 'macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx')
-rw-r--r-- | macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx | 94 |
1 files changed, 54 insertions, 40 deletions
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx index 8e006f6c5b..08460ad418 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98e, released 2023-03-07} +% \date{Version 0.98f, released 2023-04-24} % \maketitle % \begin{implementation} % The code is splitted into three parts: code shared by all engines, @@ -86,7 +86,7 @@ % \begin{macrocode} %<@@=tag> %<*luamode> -\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-03-07} {0.98e} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-04-24} {0.98f} {tagpdf - mc code only for the luamode } %</luamode> % \end{macrocode} @@ -323,22 +323,30 @@ % if not stashed record the absolute number \bool_if:NF \l_@@_mc_key_stash_bool { - \exp_args:NV\@@_struct_get_tag_info:nNN - \g_@@_struct_stack_current_tl - \l_@@_tmpa_tl - \l_@@_tmpb_tl + \exp_args:NV\@@_struct_get_parentrole:nNN + \g_@@_struct_stack_current_tl + \l_@@_get_parent_tmpa_tl + \l_@@_get_parent_tmpb_tl \@@_check_parent_child:VVnnN - \l_@@_tmpa_tl \l_@@_tmpb_tl - {MC}{} - \l_@@_parent_child_check_tl + \l_@@_get_parent_tmpa_tl + \l_@@_get_parent_tmpb_tl + {MC}{} + \l_@@_parent_child_check_tl \int_compare:nNnT {\l_@@_parent_child_check_tl}<{0} { + \prop_get:cnN + { g_@@_struct_ \g_@@_struct_stack_current_tl _prop} + {S} + \l_@@_tmpa_tl \msg_warning:nnxxx { tag } {role-parent-child} - { \g_@@_struct_tag_tl/\g_@@_struct_tag_NS_tl } - { MC~(=~real content) } - { 'not~allowed'. } + { \l_@@_get_parent_tmpa_tl/\l_@@_get_parent_tmpb_tl } + { MC~(real content) } + { + not~allowed~ + (struct~\g_@@_struct_stack_current_tl,~\l_@@_tmpa_tl) + } } \@@_mc_handle_stash:x { \@@_get_mc_abs_cnt: } } @@ -408,40 +416,46 @@ }, alt .code:n = % Alt property { - \str_set_convert:Noon - \l_@@_tmpa_str - { #1 } - { default } - { utf16/hex } - \tl_put_right:Nn \l_@@_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l_@@_mc_key_properties_tl { \l_@@_tmpa_str>~ } - \lua_now:e + \tl_if_empty:oF{#1} { - ltx.@@.func.store_mc_data - ( - \@@_get_mc_abs_cnt:,"alt","/Alt~<\str_use:N \l_@@_tmpa_str>" - ) - } + \str_set_convert:Noon + \l_@@_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l_@@_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l_@@_mc_key_properties_tl { \l_@@_tmpa_str>~ } + \lua_now:e + { + ltx.@@.func.store_mc_data + ( + \@@_get_mc_abs_cnt:,"alt","/Alt~<\str_use:N \l_@@_tmpa_str>" + ) + } + } }, alttext .meta:n = {alt=#1}, actualtext .code:n = % Alt property { - \str_set_convert:Noon - \l_@@_tmpa_str - { #1 } - { default } - { utf16/hex } - \tl_put_right:Nn \l_@@_mc_key_properties_tl { /Alt~< } - \tl_put_right:No \l_@@_mc_key_properties_tl { \l_@@_tmpa_str>~ } - \lua_now:e + \tl_if_empty:oF{#1} { - ltx.@@.func.store_mc_data - ( - \@@_get_mc_abs_cnt:, - "actualtext", - "/ActualText~<\str_use:N \l_@@_tmpa_str>" - ) - } + \str_set_convert:Noon + \l_@@_tmpa_str + { #1 } + { default } + { utf16/hex } + \tl_put_right:Nn \l_@@_mc_key_properties_tl { /Alt~< } + \tl_put_right:No \l_@@_mc_key_properties_tl { \l_@@_tmpa_str>~ } + \lua_now:e + { + ltx.@@.func.store_mc_data + ( + \@@_get_mc_abs_cnt:, + "actualtext", + "/ActualText~<\str_use:N \l_@@_tmpa_str>" + ) + } + } }, label .code:n = { |