summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-15 02:24:07 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-15 02:24:07 +0200
commitc4e8a504386be76f83350fd965e053c66439def0 (patch)
tree67831d9f82c1cf7cb2be1e8a6ee1dc336985c2c5
parent60c242de9b6521db6c176c06738a88b9417b0dec (diff)
downloadcontext-rst-c4e8a504386be76f83350fd965e053c66439def0.tar.gz
anonymous links fixed
-rw-r--r--rst_context.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/rst_context.lua b/rst_context.lua
index 4f333a2..a51f606 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -141,18 +141,12 @@ end
function rst_context.link_standalone (str)
return "\n"
- .. [[\\goto{\\hyphenatedurl{]]
- .. str
- .. [[}}[url(]]
- .. str
- .. [=[)]]=]
+ .. [[\\goto{\\hyphenatedurl{]] .. str .. [[}}[url(]] .. str .. [=[)]]=]
end
function rst_context.reference (str)
rst_context.addsetups("references")
str = str:match("^`?([^`]+)`?_$") -- LPEG could render this gibberish legible but not time
- --local link = rst_context.collected_references[str] or rst_context.context_references[str]
- --return [[\\goto{]] .. str .. [[}[__target_]] .. rst_context.whitespace_to_underscore(str) .. "]"
return [[\\RSTchoosegoto{__target_]] .. rst_context.whitespace_to_underscore(str) .. "}{"
.. str .. "}"
end
@@ -162,7 +156,7 @@ function rst_context.anon_reference (str)
str = str:match("^`?([^`]+)`?__$")
rst_context.anonymous_links = rst_context.anonymous_links + 1
link = "__target_anon_" .. rst_context.anonymous_links
- return [[\\goto{]] .. str .. [[}[]] .. link .. [=[]]=]
+ return [[\\goto{]] .. str .. [[}[url(]] .. link .. [=[)]]=]
end
local whitespace = S" \n\t\v"