asciidoctor-rhrev 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 749dcca33dd6cedd4b545e1f7fe8ae07c25c662d1475268b105654241a40f4d3
4
- data.tar.gz: b9f5eb774c855c427e7c891f6f6dc5623566fe04bd9b4ce62d1fb8c95817f697
3
+ metadata.gz: 6a4a09c2c018c9d8b79c1d819ff29867b1a398b683f22a4074392e0ac75c6ff4
4
+ data.tar.gz: 7e7118f6e79d519b47380d1aaf52b9e9f8c22db573d66c45c13c9a2cc91aca74
5
5
  SHA512:
6
- metadata.gz: 6dce05ff64190cf02cff0fdf39af62d481c1b3e43d7c447673a41276c644d3668a6fa5bef77fb1d19bfcb31fc555a36ebab52985bac41e174a1fb565b0117797
7
- data.tar.gz: eb056701ebd0a0289143fde96aef7dea2d5e16bae03cadcee183865a74e80623a6ffd088267bb071de31b69eeaae61fc3cb1ee78e3c431acfe701e1b1792fe6b
6
+ metadata.gz: 4115b2013f9c56541ab3919cb8ca2f71e29167d00af6a105ede4da90d4e5e5bd96ab1ac86678ae1de7550929bd8939770ae52f7a4874f1822136117e0d359568
7
+ data.tar.gz: 1f984b83343c2735c9fa7e7bd6bac3474eeabe6731a2237386d481a5f4d6f625f83368b4abf02e612bfa1898101b909237d0cb7a13286704894b8470153a2275
data/CHANGELOG.adoc CHANGED
@@ -1,5 +1,10 @@
1
1
  = Changelog
2
2
 
3
+ == 1.5.3 (2026-09-01)
4
+
5
+ * Fix `page_numbering_start_at: cover` still reporting the revision-history table and `pagerhref:` one page low when the theme has no real `front-cover-image`/`cover_front_image` of its own, for example a theme that draws its own cover through some other means. `Converter#compute_rhrev_page_numbering_start_page`'s `cover` branch fell back to plain `body_start` whenever `resolve_background_image` found nothing, matching 1.5.2's own `body`-shaped formula rather than the real one: asciidoctor-pdf itself falls back from `cover` to `title` in that case, not to `body`, and `title`'s own offset is 0 whenever the document has a title page at all (`doctype: book`, or the `title-page` attribute), regardless of whether a real front cover ever rendered. `body_start` only remains correct for the narrow remaining case of no front cover and no title page either. Reported directly against a real document: the table was one page low throughout. New regression case, `cover-no-image`, in `tests/regression/rhrev-page-numbering-start-at.rb`, confirmed to fail without the fix and pass with it
6
+ * Note: gem-only, matching 1.5.2; npm still bumps concurrently per the standing 1.5.1 policy
7
+
3
8
  == 1.5.2 (2026-09-01)
4
9
 
5
10
  * Fix revision-history and `pagerhref` page numbers being off by a fixed, per-document offset for every `page_numbering_start_at` mode other than `body` (PDF backend). `Converter#record_rhrev_body_start_page` always assumed a `body`-mode restart (wherever structural body content first renders), the only mode where that assumption holds; reported directly with real page numbers from a real document under `after-toc` (an 11-page discrepancy, exactly the front matter preceding the real restart point) and `cover` (a consistent 1-page discrepancy, exactly the cover page numbering there is contiguous with, not reset after). `Converter#compute_rhrev_page_numbering_start_page` now reads the document's own resolved mode directly, matching asciidoctor-pdf's own logic (`converter.rb`'s own `page_numbering_start_at` branches), and `Converter#correct_rhrev_page_numbering` (called once, after the whole document, table of contents included, has rendered) corrects every number `record_rhrev_body_start_page`'s own eager, body-mode-only capture recorded during traversal: `toc`/`after-toc`'s real restart point is not knowable any earlier, confirmed directly against asciidoctor-pdf's own source, since it only finalizes the table of contents' real page extent after inking it. `Catalog#recompute_display_pages` applies the correction from each entry's own already-stored real physical page number (`page_sortable`), never re-derived. An explicit integer `page_numbering_start_at` remains a known, undocumented-no-longer limitation: that mode's own formula is a genuinely different shape (the body's own first page is labeled the given integer, not necessarily displayed page "1"), not confirmed against a real build, so left unhandled rather than risk a second, differently-wrong number. Verified directly against real `asciidoctor-pdf` builds for `after-toc` and `cover` (not assumed from source reading alone): the revision-history table's own reported page cross-checked against the number actually printed in the footer of the real page a marked entry lands on, confirmed wrong before the fix and correct after, for both modes independently; `body` mode and the two existing pagination regression fixtures produce byte-identical rendered text before and after. New regression fixture, `tests/regression/rhrev-page-numbering-start-at.rb`
@@ -108,8 +108,19 @@ module Asciidoctor
108
108
  body_start = @rhrev_body_start_page || 1
109
109
  case (mode = @theme.page_numbering_start_at || 'body')
110
110
  when 'cover'
111
+ # asciidoctor-pdf itself only honors page-numbering-start-at:
112
+ # cover when a real front cover exists (front-cover-image or the
113
+ # theme's own cover_front_image); otherwise it falls back to
114
+ # title, not body, silently (converter.rb's own page_numbering_
115
+ # start_at cascade), and title's offset is 0 whenever the
116
+ # document has a title page at all (doctype book, or the
117
+ # title-page attribute), regardless of whether that title page
118
+ # itself renders. body_start only survives as the real answer
119
+ # for the narrow remaining case: no front cover AND no title
120
+ # page either.
111
121
  front_cover_path, = resolve_background_image node.document, @theme, 'front-cover-image', theme_key: :cover_front_image
112
- front_cover_path ? 1 : body_start
122
+ has_title_page = node.document.doctype == 'book' || (node.document.attr? 'title-page')
123
+ (front_cover_path || has_title_page) ? 1 : body_start
113
124
  when 'toc'
114
125
  (extent = @toc_extent) ? extent.from.page : body_start
115
126
  when 'after-toc'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-rhrev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - 白一百 baiyibai