summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/strc-ref.mkvi
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-07-06 20:02:14 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-07-06 20:02:14 +0200
commitf58860178fcd1497d52acaa3cb2ceda7531e46ac (patch)
treefc9d7d0bd694eca619699a986f74f1f95490c37a /tex/context/base/mkiv/strc-ref.mkvi
parentd6dece4edc2ef86889f99f3dbe5a6d6ed3b68b02 (diff)
downloadcontext-f58860178fcd1497d52acaa3cb2ceda7531e46ac.tar.gz
2018-07-06 19:15:00
Diffstat (limited to 'tex/context/base/mkiv/strc-ref.mkvi')
-rw-r--r--tex/context/base/mkiv/strc-ref.mkvi50
1 files changed, 30 insertions, 20 deletions
diff --git a/tex/context/base/mkiv/strc-ref.mkvi b/tex/context/base/mkiv/strc-ref.mkvi
index 0cef07780..8b887754c 100644
--- a/tex/context/base/mkiv/strc-ref.mkvi
+++ b/tex/context/base/mkiv/strc-ref.mkvi
@@ -165,6 +165,32 @@
\unhbox\b_strc_destination_nodes
\fi}
+\def\strc_references_placeholder
+ {\ifx\dotaggedplaceholder\empty\else
+ \attribute\destinationattribute\lastdestinationattribute
+ \dotaggedplaceholder
+ \fi}
+
+\unexpanded\def\strc_references_destination_point_yes
+ {\strc_references_inject_before % new
+ \dostarttagged\t!reference\empty
+ \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute\bgroup
+ \strc_references_flush_destination_nodes
+ \strc_references_placeholder
+ \egroup
+ \dostoptagged
+ \strc_references_inject_after}
+
+\unexpanded\def\strc_references_destination_point_nop
+ {\strc_references_inject_before % new
+ \dostarttagged\t!reference\empty
+ \dontleavehmode\hbox \bgroup
+ \strc_references_flush_destination_nodes
+ \strc_references_placeholder
+ \egroup
+ \dostoptagged
+ \strc_references_inject_after}
+
\unexpanded\def\strc_references_start_destination_nodes % messy but we need the delay
{\setbox\b_strc_destination_nodes\hbox\bgroup} % also sets lastdestinationattribute
@@ -238,17 +264,9 @@
\xdef\currentdestinationattribute{\number\lastdestinationattribute}%
% will become an option:
\ifnum\lastdestinationattribute>\zerocount
- \strc_references_inject_before % new
- \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute\bgroup
- \strc_references_flush_destination_nodes
- \egroup
- \strc_references_inject_after % new
+ \strc_references_destination_point_yes
\else\ifvoid\b_strc_destination_nodes\else
- \strc_references_inject_before % new
- \dontleavehmode\hbox \bgroup
- \strc_references_flush_destination_nodes
- \egroup
- \strc_references_inject_after % new
+ \strc_references_destination_point_nop
\fi\fi}
\def\strc_references_set_page_only_destination_attribute#labels% could in fact be fully expandable
@@ -322,17 +340,9 @@
\xdef\currentdestinationattribute{\number\lastdestinationattribute}%
% will become an option:
\ifnum\lastdestinationattribute>\zerocount
- \strc_references_inject_before % new
- \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute\bgroup
- \strc_references_flush_destination_nodes
- \egroup
- \strc_references_inject_after % new
+ \strc_references_destination_point_yes
\else\ifvoid\b_strc_destination_nodes\else
- \strc_references_inject_before % new
- \dontleavehmode\hbox \bgroup
- \strc_references_flush_destination_nodes
- \egroup
- \strc_references_inject_after % new
+ \strc_references_destination_point_nop
\fi\fi}
\unexpanded\def\strc_references_direct_full