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
|
# File 'lib/mdocs_kramdown/converter/mdocs_html.rb', line 8
def convert_blockquote(el, indent)
return super unless el.options[:admonition]
classes = el.attr[:types]
title = el.attr[:title]
if el.options[:collapsible]
element_id = Digest::MD5.hexdigest el.inspect
format_as_indented_block_html('div', { class: "card #{classes.join(' ')} collapsible" },
(title ? format_as_indented_block_html('div', { class: 'card-header collapsed', 'data-bs-toggle'=>'collapse','data-bs-target'=>"#collapse-#{element_id}"}, title.strip, indent + 2) : '') +
format_as_indented_block_html('div', { class: 'collapse', id: "collapse-#{element_id}" },
format_as_indented_block_html('div', { class: 'card-body' },
format_as_indented_block_html('div', { class: 'card-text' }, inner(el, indent + 2), indent + 2),
indent + 1),
indent + 1),
indent)
else
format_as_indented_block_html('div', { class: "card #{classes.join(' ')}" },
(title ? format_as_indented_block_html('div', { class: 'card-header' }, title.strip, indent + 2) : '') +
format_as_indented_block_html('div', { class: 'card-body' },
format_as_indented_block_html('div', { class: 'card-text' }, inner(el, indent + 2), indent + 2),
indent + 1),
indent)
end
end
|