summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-23 20:53:10 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-23 20:53:10 +0200
commit3c6fb2a86465050f9b7d9d28c5cd13151913a6cc (patch)
treebcf587aee22f17946c4618686b5c5dfa562e772b
parentb2c68bc5cc48ce0a517389faa52b605f49137fbe (diff)
downloadcontext-rst-3c6fb2a86465050f9b7d9d28c5cd13151913a6cc.tar.gz
no tracking of adornments with headings without overline
-rw-r--r--rst_parser.lua17
1 files 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
--------------------------------------------------------------------------------