From 18f1a4107f48beb33fced6c7c4a770a718c15aa1 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 15 Sep 2010 13:50:21 +0200 Subject: inline internal targets --- rst_context.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 -------------------------------------------------------------------------------- -- cgit v1.2.3