From e3231fb0b25f5b3bfff8610edd6b6ab4fe9f4f00 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 3 Apr 2023 23:13:48 +0800 Subject: [PATCH] chat-block-processor: init block and attribute handling --- lib/asciidoctor/custom_extensions/chat_block_processor.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/asciidoctor/custom_extensions/chat_block_processor.rb b/lib/asciidoctor/custom_extensions/chat_block_processor.rb index 558be81..de02b90 100644 --- a/lib/asciidoctor/custom_extensions/chat_block_processor.rb +++ b/lib/asciidoctor/custom_extensions/chat_block_processor.rb @@ -10,5 +10,12 @@ class ChatBlock < Asciidoctor::Extensions::BlockProcessor # TODO: Create the output. def process(parent, reader, attrs) + block = create_block parent, :pass, nil, attrs, content_model: :compound + block.add_role('dialogblock') + + attrs['name'] ||= attrs['avatar'] + attrs['avatarsdir'] ||= './avatars' + + block end end