diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-05-03 19:06:05 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-05-03 19:06:05 -0600 |
| commit | b56c8a5d828eb2ab9fef295501bde92821c610d2 (patch) | |
| tree | 244cadddec446afb68af83ff453a8f69dd67fd5a | |
| parent | 26b57b3830386370096273902639ff78dd223d81 (diff) | |
fix crash when converting chronicles example using bare theme
| -rw-r--r-- | lib/asciidoctor/pdf/converter.rb | 3 | ||||
| -rw-r--r-- | spec/converter_spec.rb | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb index f6869b31..96c102af 100644 --- a/lib/asciidoctor/pdf/converter.rb +++ b/lib/asciidoctor/pdf/converter.rb @@ -482,6 +482,7 @@ module Asciidoctor theme.description_list_term_spacing ||= 0 theme.description_list_description_indent ||= 0 theme.table_border_width ||= 0.5 + theme.thematic_break_border_color ||= '000000' theme.image_border_width ||= 0 theme.code_linenum_font_color ||= '999999' theme.callout_list_margin_top_after_code ||= 0 @@ -2414,7 +2415,7 @@ module Asciidoctor align: :left, inline_format: false, margin_bottom: @theme.description_list_term_spacing, - style: @theme.description_list_term_font_style.to_sym + style: (@theme.description_list_term_font_style || 'bold').to_sym category.terms.each {|term| convert_index_list_item term } # NOTE: see previous note for why we can't use margin_bottom method if @theme.prose_margin_bottom > y - reference_bounds.absolute_bottom diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb index 83bc1d69..8ef0a563 100644 --- a/spec/converter_spec.rb +++ b/spec/converter_spec.rb @@ -341,6 +341,13 @@ describe Asciidoctor::PDF::Converter do (expect (pdf.find_text 'one')[0]).not_to be_nil end + it 'should not crash if theme does not specify any keys when converting chronicles example' do + input_path = Pathname.new example_file 'chronicles-example.adoc' + pdf = to_pdf input_path, attribute_overrides: { 'imagesdir' => '@', 'pdf-theme' => (fixture_file 'bare-theme.yml') } + (expect pdf.pages).to have_size 14 + (expect (pdf.page 1).text).to include 'Documentation Chronicles' + end + it 'should convert background position to options' do converter = Asciidoctor::Converter.create 'pdf' { |
