aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/conversion/block.rs4
-rw-r--r--src/parser/tests.rs10
2 files changed, 10 insertions, 4 deletions
diff --git a/src/parser/conversion/block.rs b/src/parser/conversion/block.rs
index 0c313f6..cc2d7d1 100644
--- a/src/parser/conversion/block.rs
+++ b/src/parser/conversion/block.rs
@@ -104,8 +104,8 @@ fn convert_substitution_def(pair: Pair<Rule>) -> Result<e::SubstitutionDefinitio
fn convert_replace(pair: Pair<Rule>) -> Result<Vec<c::TextOrInlineElement>, Error> {
let mut pairs = pair.into_inner();
- let line = pairs.next().unwrap();
- line.into_inner().map(convert_inline).collect()
+ let paragraph = pairs.next().unwrap();
+ paragraph.into_inner().map(convert_inline).collect()
}
fn convert_image<I>(pair: Pair<Rule>) -> Result<I, Error> where I: Element + ExtraAttributes<a::Image> {
diff --git a/src/parser/tests.rs b/src/parser/tests.rs
index 075b750..a3df64c 100644
--- a/src/parser/tests.rs
+++ b/src/parser/tests.rs
@@ -118,6 +118,8 @@ fn substitutions() {
A |subst| in-line
.. |subst| replace:: substitution
+.. |subst2| replace:: it can also
+ be hanging
",
rule: Rule::document,
tokens: [
@@ -126,9 +128,13 @@ A |subst| in-line
substitution_ref(2, 9, [ substitution_name(3, 8) ]),
str(9, 17),
]),
- substitution_def(19, 53, [
+ substitution_def(19, 52, [
substitution_name(23, 28),
- replace(30, 53, [ line(39, 53, [str(39, 52)]) ])
+ replace(30, 52, [ paragraph(39, 52, [str(39, 52)]) ]),
+ ]),
+ substitution_def(53, 101, [
+ substitution_name(57, 63),
+ replace(65, 101, [ paragraph(74, 101, [str(74, 86), str(88, 100)]) ]),
]),
]
};