summaryrefslogtreecommitdiff
path: root/tex/context/base/back-exp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/back-exp.lua')
-rw-r--r--tex/context/base/back-exp.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/tex/context/base/back-exp.lua b/tex/context/base/back-exp.lua
index 1f5aefb86..dd6e13515 100644
--- a/tex/context/base/back-exp.lua
+++ b/tex/context/base/back-exp.lua
@@ -2129,9 +2129,15 @@ local function cleanxhtmltree(xmltree)
-- todo: inject xhtmlpreamble (xmlns should have be enough)
local wrapper = { tg = "a", ns = "xhtml", at = { href = "unknown" } }
for e in xml.collected(xmltree,"link") do
- local location = e.at.location
- if location then
- wrapper.at.href = "#" .. gsub(location,":","_")
+ local at = e.at
+ local href
+ if at.url then
+ href = at.url
+ elseif at.location then
+ at.href = "#" .. gsub(at.location,":","_")
+ end
+ if href then
+ wrapper.at.href = href
xmlwrap(e,wrapper)
end
end