summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-15 13:50:21 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-15 13:50:21 +0200
commit18f1a4107f48beb33fced6c7c4a770a718c15aa1 (patch)
treee41fc795a2c19a41e527ae042dcea0b467917e37
parentc4e8a504386be76f83350fd965e053c66439def0 (diff)
downloadcontext-rst-18f1a4107f48beb33fced6c7c4a770a718c15aa1.tar.gz
inline internal targets
-rw-r--r--rst_context.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/rst_context.lua b/rst_context.lua
index a51f606..1ac5f96 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -203,6 +203,10 @@ function rst_context.target (tab)
return insert
end
+function rst_context.inline_internal_target (str)
+ return "\\\\reference[__target_" .. rst_context.whitespace_to_underscore(str) .."]{}"
+end
+
function rst_context.escape (str)
str = str:gsub("\\(.)", "%1")
return str
@@ -224,7 +228,7 @@ local inline_parser = P{
+ V"emphasis"
+ V"inline_literal"
+ V"interpreted_text"
--- + V"inline_internal_target" -- TODO
+ + V"inline_internal_target" -- TODO
+ V"footnote_reference"
-- + V"substitution_reference" -- TODO
+ V"link_standalone")
@@ -378,6 +382,13 @@ local inline_parser = P{
citation_reference_label = V"letter" * (1 - V"rsquare")^1,
+ inline_internal_target = V"underscore"
+ * V"bareia"
+ * Cs((1 - V"bareia")^1)
+ * V"bareia"
+ / rst_context.inline_internal_target
+ ,
+
--------------------------------------------------------------------------------
-- Urls
--------------------------------------------------------------------------------