mirror of
https://github.com/foo-dogsquared/asciidoctor-foodogsquared-extensions.git
synced 2025-01-31 04:58:07 +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'
|
register_for 'html5'
|
||||||
|
|
||||||
def convert_chat(node)
|
def convert_chat(node)
|
||||||
attributes = []
|
attributes = add_attributes node
|
||||||
attributes << %(id="#{node.id}") if node.id
|
|
||||||
attributes << %(class="#{node.role}") if node.role
|
|
||||||
|
|
||||||
avatar_uri = node.parent.image_uri "#{node.attr 'avatarsticker'}/#{node.attr 'state'}.#{node.attr 'avatarstype'}", 'avatarsdir'
|
avatar_uri = node.parent.image_uri "#{node.attr 'avatarsticker'}/#{node.attr 'state'}.#{node.attr 'avatarstype'}", 'avatarsdir'
|
||||||
|
|
||||||
<<~HTML
|
<<~HTML
|
||||||
@ -26,5 +23,13 @@ module Asciidoctor::Foodogsquared::Converter
|
|||||||
</div>
|
</div>
|
||||||
HTML
|
HTML
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def add_attributes(node)
|
||||||
|
attributes = []
|
||||||
|
attributes << %(id="#{node.id}") if node.id
|
||||||
|
attributes << %(class="#{node.role}") if node.role
|
||||||
|
|
||||||
|
attributes
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user