From 3c6fb2a86465050f9b7d9d28c5cd13151913a6cc Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 23 Sep 2010 20:53:10 +0200 Subject: no tracking of adornments with headings without overline --- rst_parser.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/rst_parser.lua b/rst_parser.lua index f0e2709..5cf974c 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -970,11 +970,10 @@ local parser = P{ section_adorn = V"adornment_char"^1, - section = V"section_before"^-1 - * V"section_text" - * V"section_after" - * (V"end_block" + V"blank_line") + section = ((V"section_text" * V"section_once") + + (V"section_before" * V"section_text" * V"section_after")) / rst.section + * (V"end_block" + V"blank_line") , -- The whitespace handling after the overline is necessary because headings @@ -1007,6 +1006,16 @@ local parser = P{ * V"whitespace"^0 , + section_once = C(Cmt(V"section_adorn", function(s,i, adorn) + local tests = false + tests = state.valid_adornment:match(adorn) and true + warn ("sec-o", tests, adorn:sub(1,2) .. "…", "", i) + state.previousadorn = nil + return tests + end)) + * V"whitespace"^0 + , + -------------------------------------------------------------------------------- -- Target Blocks -------------------------------------------------------------------------------- -- cgit v1.2.3