mirror of
https://github.com/foo-dogsquared/asciidoctor-foodogsquared-extensions.git
synced 2025-02-07 06:19:01 +00:00
Update chat block output formatting
If there's any formatting here in the first place.
This commit is contained in:
parent
928cd80561
commit
42454be244
@ -17,10 +17,12 @@ class ChatBlock < Asciidoctor::Extensions::BlockProcessor
|
|||||||
# contains two output: the dialog image of our avatar and its content.
|
# contains two output: the dialog image of our avatar and its content.
|
||||||
attrs['name'] ||= attrs['avatar']
|
attrs['name'] ||= attrs['avatar']
|
||||||
|
|
||||||
block << (create_html_fragment block, %(
|
block << (create_html_fragment block, <<~HTML
|
||||||
<div role="figure" class="dialogblock dialogblock__box dialogblock__avatar--#{attrs['avatar']} #{attrs['role']}">
|
<div role="figure" class="dialogblock dialogblock__box dialogblock__avatar--#{attrs['avatar']} #{attrs['role']}">
|
||||||
<div class="dialogblock dialogblock__avatar">
|
<div class="dialogblock dialogblock__avatar">
|
||||||
))
|
HTML
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
attrs['avatarsdir'] ||= File.expand_path('./avatars', attrs['iconsdir'])
|
attrs['avatarsdir'] ||= File.expand_path('./avatars', attrs['iconsdir'])
|
||||||
attrs['avatarstype'] ||= parent.attributes['avatarstype'] || 'avif'
|
attrs['avatarstype'] ||= parent.attributes['avatarstype'] || 'avif'
|
||||||
@ -33,18 +35,20 @@ class ChatBlock < Asciidoctor::Extensions::BlockProcessor
|
|||||||
avatar_imgblock = create_image_block block, avatar_img_attrs
|
avatar_imgblock = create_image_block block, avatar_img_attrs
|
||||||
|
|
||||||
block << avatar_imgblock
|
block << avatar_imgblock
|
||||||
block << (create_html_fragment block, %(
|
block << (create_html_fragment block, <<~HTML
|
||||||
</div>
|
</div>
|
||||||
<div class="dialogblock dialogblock__text">
|
<div class="dialogblock dialogblock__text">
|
||||||
<small class="dialogblock dialogblock__avatar-name">#{attrs['name']}</small>
|
<small class="dialogblock dialogblock__avatar-name">#{attrs['name']}</small>
|
||||||
))
|
HTML
|
||||||
|
)
|
||||||
|
|
||||||
parse_content block, reader
|
parse_content block, reader
|
||||||
|
|
||||||
block << (create_html_fragment block, %(
|
block << (create_html_fragment block, <<~HTML
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))
|
HTML
|
||||||
|
)
|
||||||
|
|
||||||
block
|
block
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user