From 77c44e11aab17795bc24cb7cb6950712c23049b5 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 14 Sep 2010 12:35:58 +0200 Subject: anonymous link blocks fixed --- rst_parser.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'rst_parser.lua') diff --git a/rst_parser.lua b/rst_parser.lua index bd59806..3a87ea2 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -923,7 +923,9 @@ local parser = P{ * (V"tname_bareia" + V"tname_normal"), target_firstindent = V"eol" * Cg(V"space"^1, "indent"), + target_nextindent = V"eol" * C(V"space"^1), + target_indentmatch = Cmt(V"target_nextindent" -- I ♡ LPEG! * Cb("indent"), function (s, i, a, b) return a == b @@ -934,7 +936,7 @@ local parser = P{ * (V"target_indentmatch" * 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") + + C((1 - V"eol")^1) * V"eol" * #(V"double_dot" + V"double_underscore" + V"eol") + (1 - V"end_block")^0 * Cc(""), target = Ct((V"target_name" * (V"space"^0 * V"eol" * V"target_name")^0) @@ -943,12 +945,14 @@ local parser = P{ / rst.target, anonymous_prefix = (V"double_dot" * V"space" * V"double_underscore" * V"colon") - + (V"double_underscore"), + + (V"double_underscore") + , anonymous_target = V"anonymous_prefix" * V"space"^0 * Ct(Cc"" * V"target_link") - / rst.target, + / rst.target + , target_block = (V"anonymous_target" + V"target")^1 * V"end_block", -- cgit v1.2.3