summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/lpdf-wid.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2016-11-28 14:23:17 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-11-28 14:23:17 +0100
commitb8a38bef2eaacea0dd17897dc99f1ef09b46a7e3 (patch)
treee53017157648c5d4abab9b14ddfd23db0e43de38 /tex/context/base/mkiv/lpdf-wid.lua
parentf4d0ad2ba2c4ca5bfae469650e535fd46749b3f4 (diff)
downloadcontext-b8a38bef2eaacea0dd17897dc99f1ef09b46a7e3.tar.gz
2016-11-28 13:36:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-wid.lua')
-rw-r--r--tex/context/base/mkiv/lpdf-wid.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/lpdf-wid.lua b/tex/context/base/mkiv/lpdf-wid.lua
index 6b0024a51..fceae49cb 100644
--- a/tex/context/base/mkiv/lpdf-wid.lua
+++ b/tex/context/base/mkiv/lpdf-wid.lua
@@ -33,6 +33,7 @@ local v_hidden = variables.hidden
local v_auto = variables.auto
local v_embed = variables.embed
local v_max = variables.max
+local v_yes = variables.yes
local pdfconstant = lpdf.constant
local pdfdictionary = lpdf.dictionary
@@ -381,7 +382,7 @@ function codeinjections.attachmentid(filename) -- not used in context
return filestreams[filename]
end
-local nofcomments, usepopupcomments, stripleading = 0, false, true
+local nofcomments, usepopupcomments = 0, false
local defaultattributes = {
["xmlns"] = "http://www.w3.org/1999/xhtml",
@@ -415,10 +416,12 @@ end
function nodeinjections.comment(specification) -- brrr: seems to be done twice
nofcomments = nofcomments + 1
- local text = stripstring(specification.data or "")
- if stripleading then
+ local text = specification.data or ""
+ if specification.space ~= v_yes then
+ text = stripstring(text)
text = gsub(text,"[\n\r] *","\n")
end
+ text = gsub(text,"\r","\n")
local name, appearance = analyzesymbol(specification.symbol,comment_symbols)
local tag = specification.tag or "" -- this is somewhat messy as recent
local title = specification.title or "" -- versions of acrobat see the title