summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <gesang@stud.uni-heidelberg.de>2013-03-12 20:29:40 +0100
committerPhilipp Gesang <gesang@stud.uni-heidelberg.de>2013-03-12 20:29:40 +0100
commit49ebbc9a0de8e4b686039980595a82453dba5417 (patch)
tree28cc34ec56648078598a26f239f9a136239e6fdd
parentfdd863ed29e617f3fadaa906b2a5dfb02ea07c27 (diff)
downloadcontext-rst-49ebbc9a0de8e4b686039980595a82453dba5417.tar.gz
allow multi-line directive blocks with blanks
-rw-r--r--mod/tex/context/third/rst/rst_directives.lua2
-rw-r--r--mod/tex/context/third/rst/rst_parser.lua8
2 files changed, 7 insertions, 3 deletions
diff --git a/mod/tex/context/third/rst/rst_directives.lua b/mod/tex/context/third/rst/rst_directives.lua
index 5d8463e..8e301b1 100644
--- a/mod/tex/context/third/rst/rst_directives.lua
+++ b/mod/tex/context/third/rst/rst_directives.lua
@@ -317,7 +317,7 @@ rst_directives.container = function(data)
\csname %s\endcsname%%
\else
\relax
-\fi%%
+\fi
{%s}%%
]], name, name, content)
end
diff --git a/mod/tex/context/third/rst/rst_parser.lua b/mod/tex/context/third/rst/rst_parser.lua
index 27c77e2..6e7c225 100644
--- a/mod/tex/context/third/rst/rst_parser.lua
+++ b/mod/tex/context/third/rst/rst_parser.lua
@@ -183,13 +183,16 @@ local parser = P{
,
directive = V"explicit_markup_start"
- * C(((V"escaped_colon" + (1 - V"colon" - V"eol")) - V"substitution_text")^1)
+ * C(((V"escaped_colon" + (1 - V"colon" - V"eol"))
+ - V"substitution_text")^1)
* V"double_colon"
* (V"directive_block_multi" + V"directive_block_single")
/ rst.directive
,
- directive_block_multi = C((1 - V"eol")^0) * V"eol"
+ directive_block_multi = C((1 - V"eol")^0) -- name
+ * V"eol"
+ * V"blank_line"^-1 -- how many empty lines are permitted?
* V"directive_indented_lines"
,
@@ -225,6 +228,7 @@ local parser = P{
directive_indented_lines = V"directive_indented_first"
* V"directive_indented_other"^0
+ * (V"blank_line"^1 * V"directive_indented_other"^1)^1
,