Create a test for special blocks.
This commit is contained in:
parent
67f79aeb51
commit
5171326d63
@ -0,0 +1,5 @@
|
||||
#+begin_defun
|
||||
foo
|
||||
|
||||
{{{bar(baz)}}}
|
||||
#+end_defun
|
@ -49,11 +49,11 @@ pub fn greater_block<'r, 's>(
|
||||
}),
|
||||
))(remaining)?;
|
||||
let context_name = match Into::<&str>::into(name).to_lowercase().as_str() {
|
||||
"center" => "center block",
|
||||
"quote" => "quote block",
|
||||
_ => "greater block",
|
||||
"center" => "center block".to_owned(),
|
||||
"quote" => "quote block".to_owned(),
|
||||
name @ _ => format!("special block {}", name),
|
||||
};
|
||||
if immediate_in_section(context, context_name) {
|
||||
if immediate_in_section(context, context_name.as_str()) {
|
||||
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||
"Cannot nest objects of the same element".into(),
|
||||
))));
|
||||
@ -63,7 +63,7 @@ pub fn greater_block<'r, 's>(
|
||||
let (remaining, _nl) = line_ending(remaining)?;
|
||||
let parser_context = context
|
||||
.with_additional_node(ContextElement::ConsumeTrailingWhitespace(true))
|
||||
.with_additional_node(ContextElement::Context(context_name))
|
||||
.with_additional_node(ContextElement::Context(context_name.as_str()))
|
||||
.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
|
||||
class: ExitClass::Alpha,
|
||||
exit_matcher: &exit_with_name,
|
||||
|
Loading…
Reference in New Issue
Block a user