1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use super::prelude::*;
pub const BLOCK_BLOCKQUOTE: BlockRule = BlockRule {
name: "block-blockquote",
accepts_names: &["blockquote", "quote"],
accepts_star: false,
accepts_score: false,
accepts_newlines: true,
parse_fn,
};
fn parse_fn<'r, 't>(
parser: &mut Parser<'r, 't>,
name: &'t str,
flag_star: bool,
flag_score: bool,
in_head: bool,
) -> ParseResult<'r, 't, Elements<'t>> {
info!("Parsing blockquote block (in-head {in_head})");
assert!(!flag_star, "Blockquote doesn't allow star flag");
assert!(!flag_score, "Blockquote doesn't allow score flag");
assert_block_name(&BLOCK_BLOCKQUOTE, name);
let arguments = parser.get_head_map(&BLOCK_BLOCKQUOTE, in_head)?;
let (elements, errors, _) = parser.get_body_elements(&BLOCK_BLOCKQUOTE, true)?.into();
let element = Element::Container(Container::new(
ContainerType::Blockquote,
elements,
arguments.to_attribute_map(parser.settings()),
));
ok!(element, errors)
}