12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/asciidoctor/foodogsquared/extensions/chat-block.rb', line 12
def process(parent, reader, attrs)
attrs['name'] ||= attrs['avatar']
attrs['avatarsdir'] ||= File.expand_path('./avatars', attrs['iconsdir'])
attrs['avatarstype'] ||= parent.attributes['avatarstype'] || 'avif'
attrs['avatarsticker'] = "#{attrs['avatar'].to_kebab}/#{attrs['state'].to_kebab}.#{attrs['avatarstype']}"
block = create_block parent, :chat, nil, attrs, content_model: :compound
block.add_role 'dialogblock'
block
end
|