diff --git a/.rubocop.yml b/.rubocop.yml index 684e09b85..0bf71cbd4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -80,7 +80,8 @@ Lint/EmptyInPattern: Lint/EmptyWhen: Enabled: false Lint/FloatComparison: - Enabled: false # NOTE needed for tests + Enabled: true + Exclude: [ spec/*.rb ] Lint/IdentityComparison: Enabled: true Lint/LambdaWithoutLiteralBlock: diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb index 8b56a314f..5ab67ceab 100644 --- a/lib/asciidoctor/pdf/converter.rb +++ b/lib/asciidoctor/pdf/converter.rb @@ -320,8 +320,8 @@ def convert_document doc end unless page_count < body_start_page_number - layout_running_content :header, doc, num_front_matter_pages, body_start_page_number unless doc.noheader || @theme.header_height.to_f == 0 - layout_running_content :footer, doc, num_front_matter_pages, body_start_page_number unless doc.nofooter || @theme.footer_height.to_f == 0 + layout_running_content :header, doc, num_front_matter_pages, body_start_page_number unless doc.noheader || @theme.header_height.to_f == 0 # rubocop:disable Lint/FloatComparison + layout_running_content :footer, doc, num_front_matter_pages, body_start_page_number unless doc.nofooter || @theme.footer_height.to_f == 0 # rubocop:disable Lint/FloatComparison end add_outline doc, (doc.attr 'outlinelevels', toc_num_levels), toc_page_nums, num_front_matter_pages[1], has_front_cover