From 510985e97c8097f27f02d38a04b2206ea3e677e5 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 31 Aug 2023 19:17:46 -0400 Subject: [PATCH] Fix greater blocks by preventing nesting even if they are not the immediate parent. --- src/parser/greater_block.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/greater_block.rs b/src/parser/greater_block.rs index ff7f59c..99ff850 100644 --- a/src/parser/greater_block.rs +++ b/src/parser/greater_block.rs @@ -12,6 +12,7 @@ use nom::multi::many_till; use nom::sequence::tuple; use super::org_source::OrgSource; +use super::util::in_section; use super::Context; use crate::error::CustomError; use crate::error::MyError; @@ -26,7 +27,6 @@ use crate::parser::source::SetSource; use crate::parser::util::blank_line; use crate::parser::util::exit_matcher_parser; use crate::parser::util::get_consumed; -use crate::parser::util::immediate_in_section; use crate::parser::util::start_of_line; use crate::parser::Element; use crate::parser::Paragraph; @@ -53,7 +53,7 @@ pub fn greater_block<'r, 's>( "quote" => "quote block".to_owned(), name @ _ => format!("special block {}", name), }; - if immediate_in_section(context, context_name.as_str()) { + if in_section(context, context_name.as_str()) { return Err(nom::Err::Error(CustomError::MyError(MyError( "Cannot nest objects of the same element".into(), ))));