summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/lpdf-ano.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-02-06 20:42:35 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-02-06 20:42:35 +0100
commit1687077b0a63417ad4dce58f6c869a6e115d9b72 (patch)
treeec1d4ac5ea55b732c13c12c0c0e67739afa93ef8 /tex/context/base/mkiv/lpdf-ano.lua
parent7ce2f30f31421eb46d07ff65cbf9fcbda1d6612a (diff)
downloadcontext-1687077b0a63417ad4dce58f6c869a6e115d9b72.tar.gz
2018-02-06 18:19:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-ano.lua')
-rw-r--r--tex/context/base/mkiv/lpdf-ano.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/lpdf-ano.lua b/tex/context/base/mkiv/lpdf-ano.lua
index 5f378066d..01f015b72 100644
--- a/tex/context/base/mkiv/lpdf-ano.lua
+++ b/tex/context/base/mkiv/lpdf-ano.lua
@@ -13,7 +13,7 @@ if not modules then modules = { } end modules ['lpdf-ano'] = {
-- internal references are indicated by a number (and turned into <autoprefix><number>)
-- we only flush internal destinations that are referred
-local next, tostring, tonumber, rawget = next, tostring, tonumber, rawget
+local next, tostring, tonumber, rawget, type = next, tostring, tonumber, rawget, type
local rep, format, find = string.rep, string.format, string.find
local min = math.min
local lpegmatch = lpeg.match
@@ -706,6 +706,9 @@ local function finishreference(width,height,depth,prerolled) -- %0.2f looks okay
end
local function finishannotation(width,height,depth,prerolled,r)
+ if type(prerolled) == "function" then
+ prerolled = prerolled()
+ end
local annot = f_annot(prerolled,pdfrectangle(width,height,depth))
if r then
pdfdelayedobject(annot,r)
@@ -728,7 +731,8 @@ end
function nodeinjections.annotation(width,height,depth,prerolled,r)
if prerolled then
if trace_references then
- report_references("special: width %p, height %p, depth %p, prerolled %a",width,height,depth,prerolled)
+ report_references("special: width %p, height %p, depth %p, prerolled %a",width,height,depth,
+ type(prerolled) == "string" and prerolled or "-")
end
return new_latelua(function() finishannotation(width,height,depth,prerolled,r or false) end)
end