From 024f56f3b790180cebbe25a93e7e5d679fdfca8f Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Fri, 26 Aug 2022 23:56:27 -0600 Subject: revert kwarg to opts on numbered_title method the way we invoke the method makes it impossible to support kwargs across Ruby impls --- lib/asciidoctor/pdf/converter.rb | 4 ++-- lib/asciidoctor/pdf/ext/asciidoctor/section.rb | 4 ++-- lib/asciidoctor/pdf/section_info_by_page.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb index 676ac4d2..105d68ca 100644 --- a/lib/asciidoctor/pdf/converter.rb +++ b/lib/asciidoctor/pdf/converter.rb @@ -128,8 +128,8 @@ module Asciidoctor ViewportWidth = ::Module.new ImageWidth = ::Module.new (TitleStyles = { - 'toc' => [:numbered_title, {}], - 'basic' => [:title, {}], + 'toc' => [:numbered_title], + 'basic' => [:title], }).default = [:numbered_title, formal: true] def initialize backend, opts diff --git a/lib/asciidoctor/pdf/ext/asciidoctor/section.rb b/lib/asciidoctor/pdf/ext/asciidoctor/section.rb index 67214963..28d011c5 100644 --- a/lib/asciidoctor/pdf/ext/asciidoctor/section.rb +++ b/lib/asciidoctor/pdf/ext/asciidoctor/section.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class Asciidoctor::Section - def numbered_title formal: nil + def numbered_title opts = {} @cached_numbered_title ||= nil unless @cached_numbered_title if @numbered && !@caption && (slevel = @level) <= (@document.attr 'sectnumlevels', 3).to_i @@ -28,7 +28,7 @@ class Asciidoctor::Section @cached_numbered_title = @cached_formal_numbered_title = captioned_title end end - formal ? @cached_formal_numbered_title : @cached_numbered_title + opts[:formal] ? @cached_formal_numbered_title : @cached_numbered_title end unless method_defined? :numbered_title def first_section_of_part? diff --git a/lib/asciidoctor/pdf/section_info_by_page.rb b/lib/asciidoctor/pdf/section_info_by_page.rb index f6a346d7..581b5741 100644 --- a/lib/asciidoctor/pdf/section_info_by_page.rb +++ b/lib/asciidoctor/pdf/section_info_by_page.rb @@ -10,7 +10,7 @@ module Asciidoctor def []= pgnum, val if ::Asciidoctor::Section === val - @table[pgnum] = { title: (val.send @title_method[0], **@title_method[1]), numeral: val.numeral } + @table[pgnum] = { title: val.send(*@title_method), numeral: val.numeral } else @table[pgnum] = { title: val } end -- cgit v1.2.3