From f000dddf30b29568512dcdaa969c2ece42b88413 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 16 Sep 2010 13:52:00 +0200 Subject: fixed ambiguity in definition lists vs. block quotes --- rst_parser.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rst_parser.lua b/rst_parser.lua index bee69f7..6f5acbf 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -98,7 +98,8 @@ local parser = P{ -- Blocks -------------------------------------------------------------------------------- - block = V"target_block" + block = V"explicit_markup" + + V"target_block" + Cs(V"list") / rst.escape + V"line_block" + Cs(V"table_block") / rst.escape @@ -106,7 +107,6 @@ local parser = P{ + Cs(V"transition") --/ rst.escape + V"literal_block" + Cs(V"block_quote") / rst.escape - + V"explicit_markup" + V"comment" + Cs(V"paragraph") / rst.escape , @@ -115,11 +115,6 @@ local parser = P{ -- Explicit markup block -------------------------------------------------------------------------------- - --explicit_markup = V"double_dot" * V"whitespace" - --* V"explicit_body" - --* V"whitespace" - --, - explicit_markup_start = V"double_dot" * V"whitespace", explicit_markup = V"footnote_block" @@ -128,6 +123,12 @@ local parser = P{ --+ V"comment block" , + --explicit_markup = V"substitution_definition" + ----+ V"directive" + --+ V"footnote_block" + ----+ V"comment block" + --, + explicit_markup_block = V"explicit_markup"^1 * V"end_block" , @@ -734,7 +735,7 @@ local parser = P{ * Ct(V"definition_def")) , - definition_term = (1 - V"eol" - V"definition_classifier_separator")^1 + definition_term = -#V"space" * (1 - V"eol" - V"definition_classifier_separator")^1 , definition_classifier_separator = V"space" * V"colon" * V"space", -- cgit v1.2.3