diff --git a/lib/asciidoctor-epub3/converter.rb b/lib/asciidoctor-epub3/converter.rb index 8786adf..7537dae 100644 --- a/lib/asciidoctor-epub3/converter.rb +++ b/lib/asciidoctor-epub3/converter.rb @@ -838,15 +838,30 @@ def convert_table(node) end def convert_colist(node) - lines = ['
-
    '] - num = CALLOUT_START_NUM - node.items.each_with_index do |item, i| - lines << %(
  1. #{num} #{item.text}#{item.content if item.blocks?}
  2. ) - num = num.next + lines = ['
    '] + font_icons = (node.document.attr? 'icons', 'font') + if font_icons + num = CALLOUT_START_NUM + lines << '
      ' + node.items.each_with_index do |item, i| + lines << %(
    1. #{num} #{item.text}#{item.content if item.blocks?}
    2. ) + num = num.next + end + lines << '
    ' + else + num = 1 + lines << '' + node.items.each_with_index do |item, i| + lines << '' + lines << %() + lines << %() + lines << '' + register_media_file node, "#{node.icon_uri "callouts/#{i + 1}"}", 'image' + num = num.next + end + lines << '
    #{num}#{item.text}#{item.blocks? ? LF + item.content : ''}
    ' end - lines << '
-
' + lines << '' end # TODO: add complex class if list has nested blocks @@ -1243,10 +1258,17 @@ def convert_inline_button(node) end def convert_inline_callout(node) - num = CALLOUT_START_NUM - int_num = node.text.to_i - (int_num - 1).times { num = num.next } - %(#{num}) + lines = '' + font_icons = (node.document.attr? 'icons', 'font') + if font_icons + num = CALLOUT_START_NUM + int_num = node.text.to_i + (int_num - 1).times { num = num.next } + %(#{num}) + else + src = node.icon_uri("callouts/#{node.text}") + lines << %() + end end # @param node [Asciidoctor::Inline]