Fix avatarstype attribute override for chat block

This commit is contained in:
Gabriel Arazas 2023-07-09 17:41:00 +08:00
parent 53e225f76c
commit 1faf4d45ec
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -6,7 +6,7 @@ class ChatBlock < Asciidoctor::Extensions::BlockProcessor
named :chat
on_context :example
name_positional_attributes 'avatar', 'state'
default_attributes 'state' => 'default', 'avatarstype' => 'avif'
default_attributes 'state' => 'default'
def process(parent, reader, attrs)
block = create_block parent, :pass, nil, attrs, content_model: :compound
@ -23,6 +23,7 @@ class ChatBlock < Asciidoctor::Extensions::BlockProcessor
))
attrs['avatarsdir'] ||= File.expand_path('./avatars', attrs['iconsdir'])
attrs['avatarstype'] ||= 'avif'
avatar_sticker = "#{attrs['avatar'].to_kebab}/#{attrs['state'].to_kebab}.#{attrs['avatarstype']}"
avatar_img_attrs = {