diff options
| author | Marat Radchenko <marat@slonopotamus.org> | 2024-01-31 11:04:54 +0300 |
|---|---|---|
| committer | Marat Radchenko <marat@slonopotamus.org> | 2024-01-31 11:04:54 +0300 |
| commit | bd4775fa56bece0915be808732e2cfd3049d1036 (patch) | |
| tree | 4573c6eea1d47848751acdd5b1fa6502abaf0363 | |
| parent | 96724940c7e0f1142f2b090e0887861f531c154a (diff) | |
resolves #463 add support for blocks in callouts
| -rw-r--r-- | CHANGELOG.adoc | 3 | ||||
| -rw-r--r-- | lib/asciidoctor-epub3/converter.rb | 2 | ||||
| -rw-r--r-- | spec/converter_spec.rb | 15 |
3 files changed, 18 insertions, 2 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 3d74bdd..6ce3b87 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -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 diff --git a/lib/asciidoctor-epub3/converter.rb b/lib/asciidoctor-epub3/converter.rb index ffab410..1466956 100644 --- a/lib/asciidoctor-epub3/converter.rb +++ b/lib/asciidoctor-epub3/converter.rb @@ -834,7 +834,7 @@ document.addEventListener('DOMContentLoaded', function(event, reader) { <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> diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb index 454f6f1..a400384 100644 --- a/spec/converter_spec.rb +++ b/spec/converter_spec.rb @@ -327,6 +327,21 @@ describe Asciidoctor::Epub3::Converter do 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 |
