summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context/data/scite/context.properties6
-rw-r--r--scripts/context/lua/mtxrun.lua87
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua87
-rw-r--r--scripts/context/stubs/unix/mtxrun87
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4091 -> 4089 bytes
-rw-r--r--tex/context/base/context-version.pngbin105302 -> 104744 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/lpdf-fmt.lua2
-rw-r--r--tex/context/base/lxml-tab.lua67
-rw-r--r--tex/context/base/lxml-xml.lua21
-rw-r--r--tex/context/base/pack-rul.mkiv2
-rw-r--r--tex/context/base/s-mod-00.mkiv12
-rw-r--r--tex/context/base/scrn-fld.mkvi2
-rw-r--r--tex/context/base/status-files.pdfbin23872 -> 23870 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin162209 -> 162205 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
19 files changed, 214 insertions, 169 deletions
diff --git a/context/data/scite/context.properties b/context/data/scite/context.properties
index 3badb06ea..d9db457b9 100644
--- a/context/data/scite/context.properties
+++ b/context/data/scite/context.properties
@@ -323,11 +323,11 @@ Alt+F12|IDM_STOPEXECUTE|\
if PLAT_WIN
font.monospace=font:Dejavu Sans Mono,size:14
- font.errorfont=font:Dejavu Sans Mono,size:7
+ font.errorfont=font:Dejavu Sans Mono,size:8
if PLAT_GTK
font.monospace=font:!Dejavu Sans Mono,size:14
- font.errorfont=font:!Dejavu Sans Mono,size:7
+ font.errorfont=font:!Dejavu Sans Mono,size:8
font.base=$(font.monospace)
font.comment=$(font.monospace)
@@ -454,7 +454,7 @@ api.*.tex=t:\sources\cont-en-scite.api
# Logging
-style.errorlist.32=$(font.errorfont)
+style.errorlist.32=$(font.errorfont),$(color.back.logpanel)
# Default
style.errorlist.0=fore:#000000
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 6ac5a5ce5..cabbadb66 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -6905,7 +6905,7 @@ local predefined_simplified = {
local nofprivates = 0xF0000 -- shared but seldom used
-local privates_u = {
+local privates_u = { -- unescaped
[ [[&]] ] = "&",
[ [["]] ] = """,
[ [[']] ] = "'",
@@ -7016,40 +7016,44 @@ local function handle_any_entity(str)
if not a then
a = resolve_predefined and predefined_simplified[str]
if a then
- -- one of the predefined
- elseif type(resolve) == "function" then
- a = resolve(str) or entities[str]
- else
- a = entities[str]
- end
- if a then
- if type(a) == "function" then
- if trace_entities then
- report_xml("expanding entity &%s; (function)",str)
- end
- a = a(str) or ""
- end
- a = lpegmatch(parsedentity,a) or a
if trace_entities then
- report_xml("resolved entity &%s; -> %s (internal)",str,a)
+ report_xml("resolved entity &%s; -> %s (predefined)",str,a)
end
else
- local unknown_any_entity = placeholders.unknown_any_entity
- if unknown_any_entity then
- a = unknown_any_entity(str) or ""
+ if type(resolve) == "function" then
+ a = resolve(str) or entities[str]
+ else
+ a = entities[str]
end
if a then
+ if type(a) == "function" then
+ if trace_entities then
+ report_xml("expanding entity &%s; (function)",str)
+ end
+ a = a(str) or ""
+ end
+ a = lpegmatch(parsedentity,a) or a -- for nested
if trace_entities then
- report_xml("resolved entity &%s; -> %s (external)",str,a)
+ report_xml("resolved entity &%s; -> %s (internal)",str,a)
end
else
- if trace_entities then
- report_xml("keeping entity &%s;",str)
+ local unknown_any_entity = placeholders.unknown_any_entity
+ if unknown_any_entity then
+ a = unknown_any_entity(str) or ""
end
- if str == "" then
- a = "&error;"
+ if a then
+ if trace_entities then
+ report_xml("resolved entity &%s; -> %s (external)",str,a)
+ end
else
- a = "&" .. str .. ";"
+ if trace_entities then
+ report_xml("keeping entity &%s;",str)
+ end
+ if str == "" then
+ a = "&error;"
+ else
+ a = "&" .. str .. ";"
+ end
end
end
end
@@ -7191,6 +7195,7 @@ local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * val
local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace * doctypeset
local simpledoctype = (1-close)^1 -- * balanced^0
local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
+local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
local instruction = (spacing * begininstruction * someinstruction * endinstruction) / function(...) add_special("@pi@",...) end
local comment = (spacing * begincomment * somecomment * endcomment ) / function(...) add_special("@cm@",...) end
@@ -7244,6 +7249,7 @@ local function xmlconvert(data, settings)
resolve_predefined = true
end
--
+ --
stack, top, at, xmlns, errorstr = { }, { }, { }, { }, nil
acache, hcache, dcache = { }, { }, { } -- not stored
reported_attribute_errors = { }
@@ -7304,11 +7310,11 @@ local function xmlconvert(data, settings)
if errorstr and errorstr ~= "" then
result.error = true
end
-strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
-unify_predefined, cleanup, entities = nil, nil, nil
-stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
-acache, hcache, dcache = nil, nil, nil
-reported_attribute_errors, mt, errorhandler = nil, nil, nil
+ strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
+ unify_predefined, cleanup, entities = nil, nil, nil
+ stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
+ acache, hcache, dcache = nil, nil, nil
+ reported_attribute_errors, mt, errorhandler = nil, nil, nil
return result
end
@@ -9897,10 +9903,10 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected) -- hybrid
+local function raw(collected) -- hybrid (not much different from text so it might go)
if collected then
local e = collected[1] or collected
- return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
+ return e and xmltostring(e) or "" -- only first as we cannot concat function
else
return ""
end
@@ -9924,10 +9930,15 @@ local xmltexthandler = xmlnewhandlers {
}
local function xmltotext(root)
- if not root then
+ local dt = root.dt
+ if not dt then
return ""
- elseif type(root) == 'string' then
- return root
+ end
+ local nt = #dt -- string or table
+ if nt == 0 then
+ return ""
+ elseif nt == 1 and type(dt[1]) == "string" then
+ return dt[1] -- no escaping of " ' < > &
else
return xmlserialize(root,xmltexthandler) or ""
end
@@ -9938,7 +9949,7 @@ end
local function text(collected) -- hybrid
if collected then
local e = collected[1] or collected
- return (e and xmltotext(e.dt)) or ""
+ return (e and xmltotext(e)) or ""
else
return ""
end
@@ -10086,10 +10097,10 @@ function xml.text(id,pattern)
if pattern then
-- return text(xmlfilter(id,pattern))
local collected = xmlfilter(id,pattern)
- return (collected and xmltotext(collected[1].dt)) or ""
+ return (collected and xmltotext(collected[1])) or ""
elseif id then
-- return text(id)
- return xmltotext(id.dt) or ""
+ return xmltotext(id) or ""
else
return ""
end
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 6ac5a5ce5..cabbadb66 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -6905,7 +6905,7 @@ local predefined_simplified = {
local nofprivates = 0xF0000 -- shared but seldom used
-local privates_u = {
+local privates_u = { -- unescaped
[ [[&]] ] = "&amp;",
[ [["]] ] = "&quot;",
[ [[']] ] = "&apos;",
@@ -7016,40 +7016,44 @@ local function handle_any_entity(str)
if not a then
a = resolve_predefined and predefined_simplified[str]
if a then
- -- one of the predefined
- elseif type(resolve) == "function" then
- a = resolve(str) or entities[str]
- else
- a = entities[str]
- end
- if a then
- if type(a) == "function" then
- if trace_entities then
- report_xml("expanding entity &%s; (function)",str)
- end
- a = a(str) or ""
- end
- a = lpegmatch(parsedentity,a) or a
if trace_entities then
- report_xml("resolved entity &%s; -> %s (internal)",str,a)
+ report_xml("resolved entity &%s; -> %s (predefined)",str,a)
end
else
- local unknown_any_entity = placeholders.unknown_any_entity
- if unknown_any_entity then
- a = unknown_any_entity(str) or ""
+ if type(resolve) == "function" then
+ a = resolve(str) or entities[str]
+ else
+ a = entities[str]
end
if a then
+ if type(a) == "function" then
+ if trace_entities then
+ report_xml("expanding entity &%s; (function)",str)
+ end
+ a = a(str) or ""
+ end
+ a = lpegmatch(parsedentity,a) or a -- for nested
if trace_entities then
- report_xml("resolved entity &%s; -> %s (external)",str,a)
+ report_xml("resolved entity &%s; -> %s (internal)",str,a)
end
else
- if trace_entities then
- report_xml("keeping entity &%s;",str)
+ local unknown_any_entity = placeholders.unknown_any_entity
+ if unknown_any_entity then
+ a = unknown_any_entity(str) or ""
end
- if str == "" then
- a = "&error;"
+ if a then
+ if trace_entities then
+ report_xml("resolved entity &%s; -> %s (external)",str,a)
+ end
else
- a = "&" .. str .. ";"
+ if trace_entities then
+ report_xml("keeping entity &%s;",str)
+ end
+ if str == "" then
+ a = "&error;"
+ else
+ a = "&" .. str .. ";"
+ end
end
end
end
@@ -7191,6 +7195,7 @@ local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * val
local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace * doctypeset
local simpledoctype = (1-close)^1 -- * balanced^0
local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
+local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
local instruction = (spacing * begininstruction * someinstruction * endinstruction) / function(...) add_special("@pi@",...) end
local comment = (spacing * begincomment * somecomment * endcomment ) / function(...) add_special("@cm@",...) end
@@ -7244,6 +7249,7 @@ local function xmlconvert(data, settings)
resolve_predefined = true
end
--
+ --
stack, top, at, xmlns, errorstr = { }, { }, { }, { }, nil
acache, hcache, dcache = { }, { }, { } -- not stored
reported_attribute_errors = { }
@@ -7304,11 +7310,11 @@ local function xmlconvert(data, settings)
if errorstr and errorstr ~= "" then
result.error = true
end
-strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
-unify_predefined, cleanup, entities = nil, nil, nil
-stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
-acache, hcache, dcache = nil, nil, nil
-reported_attribute_errors, mt, errorhandler = nil, nil, nil
+ strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
+ unify_predefined, cleanup, entities = nil, nil, nil
+ stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
+ acache, hcache, dcache = nil, nil, nil
+ reported_attribute_errors, mt, errorhandler = nil, nil, nil
return result
end
@@ -9897,10 +9903,10 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected) -- hybrid
+local function raw(collected) -- hybrid (not much different from text so it might go)
if collected then
local e = collected[1] or collected
- return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
+ return e and xmltostring(e) or "" -- only first as we cannot concat function
else
return ""
end
@@ -9924,10 +9930,15 @@ local xmltexthandler = xmlnewhandlers {
}
local function xmltotext(root)
- if not root then
+ local dt = root.dt
+ if not dt then
return ""
- elseif type(root) == 'string' then
- return root
+ end
+ local nt = #dt -- string or table
+ if nt == 0 then
+ return ""
+ elseif nt == 1 and type(dt[1]) == "string" then
+ return dt[1] -- no escaping of " ' < > &
else
return xmlserialize(root,xmltexthandler) or ""
end
@@ -9938,7 +9949,7 @@ end
local function text(collected) -- hybrid
if collected then
local e = collected[1] or collected
- return (e and xmltotext(e.dt)) or ""
+ return (e and xmltotext(e)) or ""
else
return ""
end
@@ -10086,10 +10097,10 @@ function xml.text(id,pattern)
if pattern then
-- return text(xmlfilter(id,pattern))
local collected = xmlfilter(id,pattern)
- return (collected and xmltotext(collected[1].dt)) or ""
+ return (collected and xmltotext(collected[1])) or ""
elseif id then
-- return text(id)
- return xmltotext(id.dt) or ""
+ return xmltotext(id) or ""
else
return ""
end
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 6ac5a5ce5..cabbadb66 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -6905,7 +6905,7 @@ local predefined_simplified = {
local nofprivates = 0xF0000 -- shared but seldom used
-local privates_u = {
+local privates_u = { -- unescaped
[ [[&]] ] = "&amp;",
[ [["]] ] = "&quot;",
[ [[']] ] = "&apos;",
@@ -7016,40 +7016,44 @@ local function handle_any_entity(str)
if not a then
a = resolve_predefined and predefined_simplified[str]
if a then
- -- one of the predefined
- elseif type(resolve) == "function" then
- a = resolve(str) or entities[str]
- else
- a = entities[str]
- end
- if a then
- if type(a) == "function" then
- if trace_entities then
- report_xml("expanding entity &%s; (function)",str)
- end
- a = a(str) or ""
- end
- a = lpegmatch(parsedentity,a) or a
if trace_entities then
- report_xml("resolved entity &%s; -> %s (internal)",str,a)
+ report_xml("resolved entity &%s; -> %s (predefined)",str,a)
end
else
- local unknown_any_entity = placeholders.unknown_any_entity
- if unknown_any_entity then
- a = unknown_any_entity(str) or ""
+ if type(resolve) == "function" then
+ a = resolve(str) or entities[str]
+ else
+ a = entities[str]
end
if a then
+ if type(a) == "function" then
+ if trace_entities then
+ report_xml("expanding entity &%s; (function)",str)
+ end
+ a = a(str) or ""
+ end
+ a = lpegmatch(parsedentity,a) or a -- for nested
if trace_entities then
- report_xml("resolved entity &%s; -> %s (external)",str,a)
+ report_xml("resolved entity &%s; -> %s (internal)",str,a)
end
else
- if trace_entities then
- report_xml("keeping entity &%s;",str)
+ local unknown_any_entity = placeholders.unknown_any_entity
+ if unknown_any_entity then
+ a = unknown_any_entity(str) or ""
end
- if str == "" then
- a = "&error;"
+ if a then
+ if trace_entities then
+ report_xml("resolved entity &%s; -> %s (external)",str,a)
+ end
else
- a = "&" .. str .. ";"
+ if trace_entities then
+ report_xml("keeping entity &%s;",str)
+ end
+ if str == "" then
+ a = "&error;"
+ else
+ a = "&" .. str .. ";"
+ end
end
end
end
@@ -7191,6 +7195,7 @@ local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * val
local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace * doctypeset
local simpledoctype = (1-close)^1 -- * balanced^0
local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
+local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
local instruction = (spacing * begininstruction * someinstruction * endinstruction) / function(...) add_special("@pi@",...) end
local comment = (spacing * begincomment * somecomment * endcomment ) / function(...) add_special("@cm@",...) end
@@ -7244,6 +7249,7 @@ local function xmlconvert(data, settings)
resolve_predefined = true
end
--
+ --
stack, top, at, xmlns, errorstr = { }, { }, { }, { }, nil
acache, hcache, dcache = { }, { }, { } -- not stored
reported_attribute_errors = { }
@@ -7304,11 +7310,11 @@ local function xmlconvert(data, settings)
if errorstr and errorstr ~= "" then
result.error = true
end
-strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
-unify_predefined, cleanup, entities = nil, nil, nil
-stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
-acache, hcache, dcache = nil, nil, nil
-reported_attribute_errors, mt, errorhandler = nil, nil, nil
+ strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
+ unify_predefined, cleanup, entities = nil, nil, nil
+ stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
+ acache, hcache, dcache = nil, nil, nil
+ reported_attribute_errors, mt, errorhandler = nil, nil, nil
return result
end
@@ -9897,10 +9903,10 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected) -- hybrid
+local function raw(collected) -- hybrid (not much different from text so it might go)
if collected then
local e = collected[1] or collected
- return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
+ return e and xmltostring(e) or "" -- only first as we cannot concat function
else
return ""
end
@@ -9924,10 +9930,15 @@ local xmltexthandler = xmlnewhandlers {
}
local function xmltotext(root)
- if not root then
+ local dt = root.dt
+ if not dt then
return ""
- elseif type(root) == 'string' then
- return root
+ end
+ local nt = #dt -- string or table
+ if nt == 0 then
+ return ""
+ elseif nt == 1 and type(dt[1]) == "string" then
+ return dt[1] -- no escaping of " ' < > &
else
return xmlserialize(root,xmltexthandler) or ""
end
@@ -9938,7 +9949,7 @@ end
local function text(collected) -- hybrid
if collected then
local e = collected[1] or collected
- return (e and xmltotext(e.dt)) or ""
+ return (e and xmltotext(e)) or ""
else
return ""
end
@@ -10086,10 +10097,10 @@ function xml.text(id,pattern)
if pattern then
-- return text(xmlfilter(id,pattern))
local collected = xmlfilter(id,pattern)
- return (collected and xmltotext(collected[1].dt)) or ""
+ return (collected and xmltotext(collected[1])) or ""
elseif id then
-- return text(id)
- return xmltotext(id.dt) or ""
+ return xmltotext(id) or ""
else
return ""
end
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 606d035fd..b6dbba5e0 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2011.08.23 13:04}
+\newcontextversion{2011.08.26 01:43}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 22b9b10d9..6ee2a3bfb 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2011.08.23 13:04}
+\newcontextversion{2011.08.26 01:43}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index a43882f0a..8c927f12b 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index 192df98ef..4e9c93bbe 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index ce774e9d8..578783b40 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2011.08.23 13:04}
+\edef\contextversion{2011.08.26 01:43}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 705823f3b..433fbb340 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2011.08.23 13:04}
+\edef\contextversion{2011.08.26 01:43}
%D For those who want to use this:
diff --git a/tex/context/base/lpdf-fmt.lua b/tex/context/base/lpdf-fmt.lua
index 29f2ef5a0..8e118db12 100644
--- a/tex/context/base/lpdf-fmt.lua
+++ b/tex/context/base/lpdf-fmt.lua
@@ -438,7 +438,7 @@ local function handleinternalprofile(s,include)
elseif not channel then
report_backend("error, couldn't resolve channel entry for colorspace '%s'",colorspace)
else
- profile = pdfflushstreamfileobject(fullname,{ N = channel },false) -- uncompressed
+ profile = pdfflushstreamfileobject(fullname,pdfdictionary{ N = channel },false) -- uncompressed
internalprofiles[tag] = profile
if trace_format then
report_backend("including '%s' color profile from '%s'",colorspace,fullname)
diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua
index 99c7226a8..1e4601998 100644
--- a/tex/context/base/lxml-tab.lua
+++ b/tex/context/base/lxml-tab.lua
@@ -346,7 +346,7 @@ local predefined_simplified = {
local nofprivates = 0xF0000 -- shared but seldom used
-local privates_u = {
+local privates_u = { -- unescaped
[ [[&]] ] = "&amp;",
[ [["]] ] = "&quot;",
[ [[']] ] = "&apos;",
@@ -457,40 +457,44 @@ local function handle_any_entity(str)
if not a then
a = resolve_predefined and predefined_simplified[str]
if a then
- -- one of the predefined
- elseif type(resolve) == "function" then
- a = resolve(str) or entities[str]
- else
- a = entities[str]
- end
- if a then
- if type(a) == "function" then
- if trace_entities then
- report_xml("expanding entity &%s; (function)",str)
- end
- a = a(str) or ""
- end
- a = lpegmatch(parsedentity,a) or a
if trace_entities then
- report_xml("resolved entity &%s; -> %s (internal)",str,a)
+ report_xml("resolved entity &%s; -> %s (predefined)",str,a)
end
else
- local unknown_any_entity = placeholders.unknown_any_entity
- if unknown_any_entity then
- a = unknown_any_entity(str) or ""
+ if type(resolve) == "function" then
+ a = resolve(str) or entities[str]
+ else
+ a = entities[str]
end
if a then
+ if type(a) == "function" then
+ if trace_entities then
+ report_xml("expanding entity &%s; (function)",str)
+ end
+ a = a(str) or ""
+ end
+ a = lpegmatch(parsedentity,a) or a -- for nested
if trace_entities then
- report_xml("resolved entity &%s; -> %s (external)",str,a)
+ report_xml("resolved entity &%s; -> %s (internal)",str,a)
end
else
- if trace_entities then
- report_xml("keeping entity &%s;",str)
+ local unknown_any_entity = placeholders.unknown_any_entity
+ if unknown_any_entity then
+ a = unknown_any_entity(str) or ""
end
- if str == "" then
- a = "&error;"
+ if a then
+ if trace_entities then
+ report_xml("resolved entity &%s; -> %s (external)",str,a)
+ end
else
- a = "&" .. str .. ";"
+ if trace_entities then
+ report_xml("keeping entity &%s;",str)
+ end
+ if str == "" then
+ a = "&error;"
+ else
+ a = "&" .. str .. ";"
+ end
end
end
end
@@ -632,6 +636,7 @@ local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * val
local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace * doctypeset
local simpledoctype = (1-close)^1 -- * balanced^0
local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
+local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
local instruction = (spacing * begininstruction * someinstruction * endinstruction) / function(...) add_special("@pi@",...) end
local comment = (spacing * begincomment * somecomment * endcomment ) / function(...) add_special("@cm@",...) end
@@ -685,6 +690,8 @@ local function xmlconvert(data, settings)
resolve_predefined = true
end
--
+--~ inspect(settings)
+ --
stack, top, at, xmlns, errorstr = { }, { }, { }, { }, nil
acache, hcache, dcache = { }, { }, { } -- not stored
reported_attribute_errors = { }
@@ -745,11 +752,11 @@ local function xmlconvert(data, settings)
if errorstr and errorstr ~= "" then
result.error = true
end
-strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
-unify_predefined, cleanup, entities = nil, nil, nil
-stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
-acache, hcache, dcache = nil, nil, nil
-reported_attribute_errors, mt, errorhandler = nil, nil, nil
+ strip, utfize, resolve, resolve_predefined = nil, nil, nil, nil
+ unify_predefined, cleanup, entities = nil, nil, nil
+ stack, top, at, xmlns, errorstr = nil, nil, nil, nil, nil
+ acache, hcache, dcache = nil, nil, nil
+ reported_attribute_errors, mt, errorhandler = nil, nil, nil
return result
end
diff --git a/tex/context/base/lxml-xml.lua b/tex/context/base/lxml-xml.lua
index 5012f69e5..05405015d 100644
--- a/tex/context/base/lxml-xml.lua
+++ b/tex/context/base/lxml-xml.lua
@@ -111,10 +111,10 @@ local function chainattribute(collected,arguments) -- todo: optional levels
return ""
end
-local function raw(collected) -- hybrid
+local function raw(collected) -- hybrid (not much different from text so it might go)
if collected then
local e = collected[1] or collected
- return (e and xmlserialize(e)) or "" -- only first as we cannot concat function
+ return e and xmltostring(e) or "" -- only first as we cannot concat function
else
return ""
end
@@ -138,10 +138,15 @@ local xmltexthandler = xmlnewhandlers {
}
local function xmltotext(root)
- if not root then
+ local dt = root.dt
+ if not dt then
return ""
- elseif type(root) == 'string' then
- return root
+ end
+ local nt = #dt -- string or table
+ if nt == 0 then
+ return ""
+ elseif nt == 1 and type(dt[1]) == "string" then
+ return dt[1] -- no escaping of " ' < > &
else
return xmlserialize(root,xmltexthandler) or ""
end
@@ -152,7 +157,7 @@ end
local function text(collected) -- hybrid
if collected then
local e = collected[1] or collected
- return (e and xmltotext(e.dt)) or ""
+ return (e and xmltotext(e)) or ""
else
return ""
end
@@ -300,10 +305,10 @@ function xml.text(id,pattern)
if pattern then
-- return text(xmlfilter(id,pattern))
local collected = xmlfilter(id,pattern)
- return (collected and xmltotext(collected[1].dt)) or ""
+ return (collected and xmltotext(collected[1])) or ""
elseif id then
-- return text(id)
- return xmltotext(id.dt) or ""
+ return xmltotext(id) or ""
else
return ""
end
diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv
index c6743117c..97724ff00 100644
--- a/tex/context/base/pack-rul.mkiv
+++ b/tex/context/base/pack-rul.mkiv
@@ -1169,7 +1169,7 @@
%D future extensions.
%D \macros
-%D {\doassigncheckedframeoffset}
+%D {doassigncheckedframeoffset}
%D
%D Offset helper (see menus):
diff --git a/tex/context/base/s-mod-00.mkiv b/tex/context/base/s-mod-00.mkiv
index eadefbe12..3752f85ca 100644
--- a/tex/context/base/s-mod-00.mkiv
+++ b/tex/context/base/s-mod-00.mkiv
@@ -272,7 +272,7 @@
{\EveryPar
{\doglobal\newcounter\NOfMarginLines}}
-\def\dodomargeaanduidingen[#1]#2%
+\unexpanded\def\dodomargeaanduidingen[#1]#2%
{\def\docommand##1%
{\indent\hbox
{\ifx#2\relax
@@ -285,7 +285,7 @@
\endgraf}%
\processcommalist[#1]\docommand}
-\def\margeaanduidingen#1[#2]%
+\unexpanded\def\margeaanduidingen#1[#2]% to be renamed
{\def\domargeaanduidingen##1##2%
{\margintitle[#2]%
{\switchtobodyfont[\v!small]%
@@ -299,13 +299,13 @@
\processcommalist[##2]\index}}%
\dodoublegroupempty\domargeaanduidingen}
-\def\complexmacros{\margeaanduidingen\tex }
-\def\complexextras{\margeaanduidingen\relax}
+\unexpanded\def\complexmacros{\margeaanduidingen\tex }
+\unexpanded\def\complexextras{\margeaanduidingen\relax}
-\def\complexelements
+\unexpanded\def\complexelements
{\margeaanduidingen\someelement}
-\def\someelement#1{\type{<#1>}}
+\unexpanded\def\someelement#1{\type{<#1>}}
\definecomplexorsimpleempty\macros
\definecomplexorsimpleempty\extras
diff --git a/tex/context/base/scrn-fld.mkvi b/tex/context/base/scrn-fld.mkvi
index f25685788..c786f3832 100644
--- a/tex/context/base/scrn-fld.mkvi
+++ b/tex/context/base/scrn-fld.mkvi
@@ -443,7 +443,7 @@
\setupfieldcontentframed[#tag][\s!parent=\??wc,#variant]%
\fi\fi\fi\fi}
-\def\scrn_field_setup_fields[#variant][#totalsettings][#labelsettings][#fieldsettings]
+\def\scrn_field_setup_fields[#variant][#totalsettings][#labelsettings][#fieldsettings]%
{\iffourthargument
\setupfieldtotalframed [\c!alternative={#variant},#totalsettings]%
\setupfieldlabelframed [#labelsettings]%
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 42f71838c..c9d27a01e 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index ab1c683f0..c8d4e573f 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 8bd088870..99c22f268 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 08/23/11 13:04:49
+-- merge date : 08/26/11 01:43:42
do -- begin closure to overcome local limits and interference