mirror of
https://github.com/foo-dogsquared/asciidoctor-foodogsquared-extensions.git
synced 2025-01-30 22:57:56 +00:00
Refactor common functions
This commit is contained in:
parent
a57804d519
commit
d704253410
@ -8,10 +8,7 @@ module Asciidoctor::Foodogsquared::Converter
|
||||
register_for 'html5'
|
||||
|
||||
def convert_chat(node)
|
||||
attributes = []
|
||||
attributes << %(id="#{node.id}") if node.id
|
||||
attributes << %(class="#{node.role}") if node.role
|
||||
|
||||
attributes = add_attributes node
|
||||
avatar_uri = node.parent.image_uri "#{node.attr 'avatarsticker'}/#{node.attr 'state'}.#{node.attr 'avatarstype'}", 'avatarsdir'
|
||||
|
||||
<<~HTML
|
||||
@ -26,5 +23,13 @@ module Asciidoctor::Foodogsquared::Converter
|
||||
</div>
|
||||
HTML
|
||||
end
|
||||
|
||||
def add_attributes(node)
|
||||
attributes = []
|
||||
attributes << %(id="#{node.id}") if node.id
|
||||
attributes << %(class="#{node.role}") if node.role
|
||||
|
||||
attributes
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user