diff --git a/CHANGELOG.md b/CHANGELOG.md index efdbb811..65e2b584 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] ### Changed - - ignore AFref key with empty value. + - ignore AFref, AFinline-key with empty value. - Documentation changes ## [2023-11-19] diff --git a/tagpdf-struct.dtx b/tagpdf-struct.dtx index 35d3caed..f255ca55 100644 --- a/tagpdf-struct.dtx +++ b/tagpdf-struct.dtx @@ -1225,25 +1225,28 @@ \cs_new_protected:Npn \@@_struct_add_inline_AF:nn #1 #2 % #1 content, #2 extension { - \group_begin: - \int_gincr:N \g_@@_struct_AFobj_int - \pdffile_embed_stream:neN - {#1} - {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2} - \l_@@_tmpa_tl - \@@_struct_add_AF:ee - { \int_use:N \c@g_@@_struct_abs_int } - { \l_@@_tmpa_tl } - \@@_struct_prop_gput:nne - { \int_use:N \c@g_@@_struct_abs_int } - { AF } - { - [ - \tl_use:c - { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } - ] - } - \group_end: + \tl_if_empty:nF{#1} + { + \group_begin: + \int_gincr:N \g_@@_struct_AFobj_int + \pdffile_embed_stream:neN + {#1} + {tag-AFfile\int_use:N\g_@@_struct_AFobj_int.#2} + \l_@@_tmpa_tl + \@@_struct_add_AF:ee + { \int_use:N \c@g_@@_struct_abs_int } + { \l_@@_tmpa_tl } + \@@_struct_prop_gput:nne + { \int_use:N \c@g_@@_struct_abs_int } + { AF } + { + [ + \tl_use:c + { g_@@_struct_\int_eval:n {\c@g_@@_struct_abs_int}_AF_tl } + ] + } + \group_end: + } } \cs_generate_variant:Nn \@@_struct_add_inline_AF:nn {on}