use super::prelude::*;
pub const BLOCK_BLOCKQUOTE: BlockRule = BlockRule {
name: "block-blockquote",
accepts_names: &["blockquote", "quote"],
accepts_special: false,
accepts_newlines: true,
parse_fn,
};
fn parse_fn<'r, 't>(
log: &slog::Logger,
parser: &mut Parser<'r, 't>,
name: &'t str,
special: bool,
in_head: bool,
) -> ParseResult<'r, 't, Elements<'t>> {
debug!(log, "Parsing blockquote block"; "in-head" => in_head);
assert_eq!(special, false, "blockquote doesn't allow special variant");
assert_block_name(&BLOCK_BLOCKQUOTE, name);
let arguments = parser.get_head_map(&BLOCK_BLOCKQUOTE, in_head)?;
let (elements, exceptions) =
parser.get_body_elements(&BLOCK_BLOCKQUOTE, true)?.into();
let element = Element::StyledContainer(StyledContainer::new(
StyledContainerType::Blockquote,
elements,
arguments.to_hash_map(),
));
ok!(element, exceptions)
}