From bd4775fa56bece0915be808732e2cfd3049d1036 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Wed, 31 Jan 2024 11:04:54 +0300 Subject: resolves #463 add support for blocks in callouts --- CHANGELOG.adoc | 3 ++- lib/asciidoctor-epub3/converter.rb | 2 +- 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) {
    '] num = CALLOUT_START_NUM node.items.each_with_index do |item, i| - lines << %(
  1. #{num} #{item.text}
  2. ) + lines << %(
  3. #{num} #{item.text}#{item.content if item.blocks?}
  4. ) num = num.next end lines << '
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 -- cgit v1.2.3