Skip to content

Commit

Permalink
resolves #463 add support for blocks in callouts
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Jan 31, 2024
1 parent 9672494 commit bd4775f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[

== Unreleased

* Drop MOBI support
* drop MOBI support
* add support for blocks in callouts (#463)

== 2.0.1 (2024-01-13) - @slonopotamus

Expand Down
2 changes: 1 addition & 1 deletion lib/asciidoctor-epub3/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ def convert_colist(node)
<ol>']
num = CALLOUT_START_NUM
node.items.each_with_index do |item, i|
lines << %(<li><i class="conum" data-value="#{i + 1}">#{num}</i> #{item.text}</li>)
lines << %(<li><i class="conum" data-value="#{i + 1}">#{num}</i> #{item.text}#{item.content if item.blocks?}</li>)
num = num.next
end
lines << '</ol>
Expand Down
15 changes: 15 additions & 0 deletions spec/converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,21 @@
expect(audio.media_type).to eq('audio/mpeg')
end

it 'supports blocks in colist' do
book, = to_epub <<~EOS
= Article
----
Callout target <.>
----
<.> Callout with list
* List Item 1
EOS
article = book.item_by_href '_article.xhtml'
expect(article).not_to be_nil
expect(article.content).to include 'List Item 1'
end

it 'supports horizontal dlist' do
book = to_epub <<~EOS
= Article
Expand Down

0 comments on commit bd4775f

Please sign in to comment.