carve-hexapdf 0.1.2 → 0.1.4

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: 45c5c94de95a03c35c6a7ea92a22aff7fec66c96ff2a5dc44cb36a43034426d8
4
- data.tar.gz: 0e3560d71885dd7476d999ab910a2ea0ba9b111c7dccb678979c238e26e9d63c
3
+ metadata.gz: 9ca1e064f1b2cfe5886e3c9ead5c523e39d8017f560fa045c01e18af746ebdcc
4
+ data.tar.gz: 7a5055cb52def857760862d08a68aa112623a698760169e85a23358f6f04d548
5
5
  SHA512:
6
- metadata.gz: 45f2c67a07e0036a07d862bb7cd42641bfae6a8123b668ab6b910bd67dd54a78d49f4dbe0e83a8f8f25e432207391c0b9377e13d9abf1c2f56eee95b5cf151b8
7
- data.tar.gz: b18adba4f2de1b2d2678baa7adb7ac15ce5d8d581b7ca561e186e3c2b33c0bf387b2ba58b6a336669cf33642772cbdd1cbadb06142567a5a827e53f0908f02f6
6
+ metadata.gz: 3f24bf3e136eb703f0a3561b8f929f6ede44f372b2722fdf19560669420df44ada47ead8f14e3b2f3d858681c4ab0a5488c4723e44c9598e620c9920ab63bd68
7
+ data.tar.gz: 5db634aa0f278239009b35018bc524a27295f1494c92be78f577f955d1af139086e06190207bc68f7fe4906650c52d3853fa5444f0a56b44308ec1fa07fd9e49
data/CHANGELOG.md CHANGED
@@ -5,6 +5,52 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.4] - 2026-10-23
11
+
12
+ ### Fixed
13
+
14
+ - A table continuation row (`+ x |`) joins its cell with one space, as the spec
15
+ renders it; the two halves used to run together (`1x`) (#54).
16
+ - A CriticMarkup substitution reaches the page on carve-lang 0.1.3 and older,
17
+ which publish its halves as `oldText`/`newText` strings; both halves used to
18
+ be dropped (#55).
19
+
20
+ ## [0.1.3] - 2026-10-08
21
+
22
+ ### Fixed
23
+
24
+ - **A referenced footnote's body no longer vanishes from the page.**
25
+ `register_footnote` matched a reference to its definition through
26
+ `footnote_ref[:id]`; the engine renamed that field to `label`, so no
27
+ definition resolved and the note text never reached the endnote section. The
28
+ marker still numbered itself, so a page kept `[2]` and silently lost what it
29
+ pointed at. Both spellings are accepted now.
30
+ markup-carve/carve-hexapdf#47
31
+ - **Cross-references reach the page.** The inline dispatcher had an arm for
32
+ `cross_ref` while the engine publishes `heading_ref`, so every `</#id>`
33
+ contributed nothing at all: `See </#Plan>.` drew `See .`. A resolved
34
+ reference is drawn as a link over the target heading's text, an unresolved
35
+ one back in its `</#id>` source spelling, which is how the HTML target
36
+ renders it. markup-carve/carve-hexapdf#48
37
+ - **The example PDFs match the engine the gemspec supports.** They had been
38
+ generated by carve-lang 0.1.0, the version the floor excludes, and
39
+ `examples/generate.rb` would silently use a `carve-rb` checkout that merely
40
+ happened to sit beside this one. The sibling is opt-in through
41
+ `CARVE_RB_PATH` now, the same variable the `Gemfile` reads.
42
+ markup-carve/carve-hexapdf#49
43
+
44
+ ### Changed
45
+
46
+ - Requires carve-rb v0.1.7 (carve-lang 0.1.7), up from an unreleased revision
47
+ 32 commits and two releases behind it. A document containing a single `|`
48
+ followed by an attribute block used to abort the native extension with a
49
+ fatal `byte range starts at 1 but ends at 0`, killing the process rather than
50
+ raising, so a batch render died on five bytes of valid input; it now renders
51
+ as paragraph text. Cross-references, glossary terms and numbered captions
52
+ also compare case exactly on this engine.
53
+
8
54
  ## [0.1.2] - 2026-09-19
9
55
 
10
56
  ### Fixed
@@ -514,6 +514,8 @@ module Carve
514
514
  case node[:type]
515
515
  when "text" then out << run(node[:value].to_s, ctx)
516
516
  when "soft_break" then out << run(" ", ctx)
517
+ # A `+` continuation row join; the spec renders it as one space.
518
+ when "cell_wrap" then out << run(" ", ctx)
517
519
  when "hard_break" then out << { text: "\n" }
518
520
  # Each emphasis sort is its OWN node type. They used to be one
519
521
  # `emphasis` node carrying a `kind`, so a profile could not deny bold
@@ -564,16 +566,34 @@ module Carve
564
566
  out << run("[#{number}]", ctx.merge(super: true)) if number
565
567
  when "citation_group" then out << run(node[:raw].to_s, ctx)
566
568
  when "abbreviation" then out << run(node[:abbr].to_s, ctx)
567
- when "cross_ref" then out << run(node[:target].to_s, ctx)
569
+ # `heading_ref` is what `</#id>` publishes; `cross_ref` was its name
570
+ # before the rename and is still accepted, like the footnote arm above.
571
+ # Reading only `cross_ref` dropped every cross-reference from the page
572
+ # with no marker left behind: `See </#Plan>.` drew "See .".
573
+ #
574
+ # A resolved reference carries `href` and a `target` that is the target
575
+ # heading's TEXT, so it draws as a link over that text. An unresolved
576
+ # one carries no `href` and a `target` that is the selector as authored,
577
+ # which the HTML target renders as literal source - so it is drawn back
578
+ # in its source spelling rather than as a bare word that reads like
579
+ # prose.
580
+ when "heading_ref", "cross_ref"
581
+ if node[:href].to_s.empty?
582
+ out << run("</##{node[:target]}>", ctx)
583
+ else
584
+ out << run(node[:target].to_s, ctx.merge(link: node[:href].to_s))
585
+ end
568
586
  when "caption_number" then (out << run(node[:number].to_s, ctx) if node[:number])
569
587
  when "insert" then emit_children(node, ctx.merge(underline: true), out)
570
588
  when "delete" then emit_children(node, ctx.merge(strike: true), out)
571
589
  # Both halves are inline arrays, and both reach the page: struck for the
572
590
  # replaced run, underlined for the replacement, which is what the
573
591
  # reference ANSI and HTML renderers show.
592
+ # carve-lang 0.1.3 and older publish the halves as `oldText`/`newText`
593
+ # strings; the gemspec floor still admits those engines.
574
594
  when "substitution"
575
- emit_children({ children: node[:old] }, ctx.merge(strike: true), out)
576
- emit_children({ children: node[:new] }, ctx.merge(underline: true), out)
595
+ emit_half(node[:old], node[:oldText], ctx.merge(strike: true), out)
596
+ emit_half(node[:new], node[:newText], ctx.merge(underline: true), out)
577
597
  when "smart_punctuation" then out << run(smart_punctuation_text(node), ctx)
578
598
  # A character the author escaped. The backslash is authoring syntax, so
579
599
  # the page shows the character - but the node has no children, so
@@ -630,6 +650,14 @@ module Carve
630
650
  Array(node[:children]).each { |c| emit_inline(c, ctx, out) }
631
651
  end
632
652
 
653
+ def emit_half(inlines, text, ctx, out)
654
+ if inlines.nil? && text
655
+ out << run(text.to_s, ctx)
656
+ else
657
+ emit_children({ children: inlines }, ctx, out)
658
+ end
659
+ end
660
+
633
661
  # Styling for one emphasis node.
634
662
  #
635
663
  # `/*both*/` is a single `strong` node carrying `boldItalic`, not a
@@ -767,7 +795,12 @@ module Carve
767
795
  return @footnotes.last[:number]
768
796
  end
769
797
 
770
- id = node[:id]
798
+ # `label` since carve-rb 0.1.4; `id` is the pre-rename spelling and is
799
+ # still accepted, the same way the node-type arms above accept both
800
+ # vocabularies. Reading only `id` silently dropped the body: the marker
801
+ # still numbered itself from `node[:number]`, so the page kept `[2]`
802
+ # and lost "2. Referenced note body." entirely.
803
+ id = node[:label] || node[:id]
771
804
  if id && @footnote_defs.key?(id)
772
805
  return @footnote_numbers[id] ||= begin
773
806
  @footnotes << { number: @footnotes.size + 1, blocks: @footnote_defs[id] }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Carve
4
4
  module Hexapdf
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carve-hexapdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - markup-carve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-20 00:00:00.000000000 Z
11
+ date: 2026-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carve-lang