summaryrefslogtreecommitdiff
path: root/rst_parser.lua
diff options
context:
space:
mode:
Diffstat (limited to 'rst_parser.lua')
-rw-r--r--rst_parser.lua10
1 files changed, 7 insertions, 3 deletions
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",