diff options
author | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2010-09-14 00:21:26 +0200 |
---|---|---|
committer | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2010-09-14 00:21:26 +0200 |
commit | 7d02de72030797a5829f23c0ba87ebd157f044a1 (patch) | |
tree | 0ce5996cf2f90000104ec9fec5bd81cfb9e31559 /rst_parser.lua | |
parent | 89746a438f5f65f969fb46105590a1c5d9c83423 (diff) | |
download | context-rst-7d02de72030797a5829f23c0ba87ebd157f044a1.tar.gz |
internal links now work
Diffstat (limited to 'rst_parser.lua')
-rw-r--r-- | rst_parser.lua | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/rst_parser.lua b/rst_parser.lua index 13f3a2d..bd59806 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -130,6 +130,30 @@ local parser = P{ , -------------------------------------------------------------------------------- +-- Explicit markup hyperlink target +-------------------------------------------------------------------------------- + + --hyperlink_target_block = V"hyperlink_target" + --* (V"blank_line"^-1 * V"hyperlink_target")^0 + --* V"end_block" + --, + + --hyperlink_target = V"hl_anonymous" + ----+ V"hl_named" + --, + + --hl_anonymous = V"hl_anonymous_start" + --* C(V"link_block") + --, + + --hl_anonymous_start = (V"double_underscore" + --+ V"double_dot" * V"space" * V"double_underscore" * V"colon") + --* V"whitespace" + --, + + --link_block = + +-------------------------------------------------------------------------------- -- Explicit markup footnote block -------------------------------------------------------------------------------- @@ -911,7 +935,7 @@ local parser = P{ * C(1 - V"whitespace" - V"eol")^1)^0) * V"eol" * #(1 - V"whitespace" - "eol")) / rst.joinindented + C((1 - V"eol")^1) * V"eol" * #(V"double_dot" + V"eol") - + (1 - V"end_block")^0 * Cc("make me constant!"), + + (1 - V"end_block")^0 * Cc(""), target = Ct((V"target_name" * (V"space"^0 * V"eol" * V"target_name")^0) * V"space"^0 @@ -1177,8 +1201,11 @@ local function get_setups () %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \setupcolors[state=start] -\setupinteraction[state=start,color=darkgreen,contrastcolor=darkgreen] +\setupinteraction[state=start,focus=standard,color=darkgreen,contrastcolor=darkgreen] \setupbodyfontenvironment [default] [em=italic] +\sethyphenatedurlnormal{:=?&} +\sethyphenatedurlbefore{?&} +\sethyphenatedurlafter {:=/-} ]] for item, _ in next, state.addme do @@ -1204,13 +1231,9 @@ local function main() return 1 end - for i,j in next, state.footnotes do - if type(j) == "table" then - for k,l in next, j do - print(k,l) - end - end - end + --for i,j in next, rst.anonymous_links do + --print(i,j) + --end --print(">>>Last used char>: " ..state.lastbullet.." <<<<") --print(">>>Max list nestin>: "..state.bullets.max .." <<<<") |