summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/strc-ref.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-02-15 11:15:07 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-02-15 11:15:07 +0100
commita036ac2dd19b592316e1b479360e9e6c6700e935 (patch)
tree321156a4e2af995a7f401e1b773fd8813e3928da /tex/context/base/mkiv/strc-ref.lua
parentd73f5987ca04dbdf0a134236c3314dadd7a73565 (diff)
downloadcontext-a036ac2dd19b592316e1b479360e9e6c6700e935.tar.gz
2016-02-15 10:29:00
Diffstat (limited to 'tex/context/base/mkiv/strc-ref.lua')
-rw-r--r--tex/context/base/mkiv/strc-ref.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index d9b7798e4..0cb9962d3 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -50,6 +50,8 @@ local v_file = variables.file
local v_unknown = variables.unknown
local v_page = variables.page
local v_auto = variables.auto
+local v_yes = variables.yes
+local v_name = variables.name
local context = context
local commands = commands
@@ -1877,8 +1879,10 @@ local defaultinnermethod = defaultinnermethod
references.innermethod = innermethod -- don't mess with this one directly
function references.setinnermethod(m)
- if toboolean(m) or m == v_page then
+ if toboolean(m) or m == v_page or m == v_yes then
innermethod = v_page
+ elseif m == v_name then
+ innermethod = v_name
else
innermethod = v_auto
end
@@ -1910,7 +1914,7 @@ local destinationattributes = { }
local function setinternalreference(specification)
local internal = specification.internal
local destination = unsetvalue
- if innermethod == v_auto then
+ if innermethod == v_auto or innermethod == v_name then
local t, tn = { }, 0 -- maybe add to current (now only used for tracing)
local reference = specification.reference
if reference then
@@ -1932,9 +1936,13 @@ local function setinternalreference(specification)
end
-- ugly .. later we decide to ignore it when we have a real one
-- but for testing we might want to see them all
- if internal then
- tn = tn + 1
- t[tn] = internal -- when number it's internal
+
+ if innermethod == v_page then
+ -- we dont' want too many #1 #2 #3 etc
+ if internal then
+ tn = tn + 1
+ t[tn] = internal -- when number it's internal
+ end
end
destination = references.mark(t,nil,nil,specification.view) -- returns an attribute
end
@@ -2002,7 +2010,7 @@ function references.setandgetattribute(data) -- maybe do internal automatically
if done then
attr = setinternalreference {
prefix = prefix,
- reference = tag,
+ reference = rdat.reference,
internal = rdat.internal,
view = rdat.view
} or unsetvalue