metanorma-iso 3.5.42 → 3.5.44

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: 8c4a791996a78de404d582e799c2234c9d4d5aa9250caab4e1c05443de7fe376
4
- data.tar.gz: 61aeea62b84d2cab30e7cf14e235e9797622c3c02e40db89f120a1243cc21047
3
+ metadata.gz: 85160d800ea91d670e92a2e1a29ae26cba19eb81033e61e9b8bef7a719c83557
4
+ data.tar.gz: be24fbed96e6dab380ccf71eef464b0f4c2a76574ce0d49e6308ed99d4801773
5
5
  SHA512:
6
- metadata.gz: 8a03260072fef051d274e9cbe8adb40b30343c2fe53dda0f058892efef4a8f59b80a8de3ad0bd80672725615149a49cac7880e21396dc28a923b06b50d9c71fd
7
- data.tar.gz: d592773b520fa1d8b988022082bf7fb7499a818b7835f2cbb87f8adafabe51506859ce8dde61c3835ddbaed507c3645e731afc24ef9776781a04339b3de316c0
6
+ metadata.gz: d409e6a448a0339b12d1ec1bcfbfda95dbbc815d7551f72893e4b815b0a0cd2411b61d98e3b7e963d054e866ab9e9f2f8b5d8b6f7946bd8b51dcabdd989f9d26
7
+ data.tar.gz: 222dcec902710e79cf9cf51ad182f3ba361f9b437e446f92357fd230ab11104cec1e90e3aa1bcf7bd6709f8657da41f6475a5bb0e5e0fedbdcd5f2885d9a76f7
@@ -24,8 +24,52 @@ User reports `rice-dis-output-latest.docx` won't open in Word.
24
24
  1. Remove `docProps/custom.xml` and its content type override
25
25
  2. Test opening after each removal to isolate the cause
26
26
 
27
- ## Status: DONE (verified in Microsoft Word, 2026-11-19)
27
+ ## Status: DONE (verified in Microsoft Word, 2026-11-19; re-verified on 3.5.42, 2026-12-02)
28
28
 
29
29
  ## Verification (2026-11-19)
30
30
  - rice.presentation.xml rendered to DOCX at ac2393fb (lane/1728-cards-batch4), opened in Microsoft Word read-only: no "unreadable content" or repair dialog.
31
31
  - Table of contents entries clicked in Word jump to their headings.
32
+
33
+ ## Re-verification on the 3.5.42 baseline (2026-12-02)
34
+
35
+ The 2026-11-19 verification predated the Dec 1 wave (#1945–#1948, #1953).
36
+ Re-rendered `spec/fixtures/iso/is/document-en.dis.presentation.xml` through
37
+ the documented one-process render (metanorma-iso v3.5.42 worktree, deps in
38
+ `versions.txt`) and re-ran the gate:
39
+
40
+ - Opened in Microsoft Word for Mac: no "unreadable content" or repair
41
+ dialog; the document opens, OMML math renders, and the file mtime is
42
+ unchanged after close (no repair + save). Baseline artifacts at
43
+ `~/metanorma/baselines/138-14/` (`dis.doc`, `dis.docx`, `versions.txt`).
44
+ - 26-point OOXML audit green (ZIP attributes, XML well-formedness, control
45
+ bytes, content types, rel targets, style/numId/footnote/hyperlink
46
+ resolution, required styles, sectPr position, pPr/rPr ordering, no
47
+ LF/CR/TAB in `w:t`, mc:Ignorable declarations, custom.xml, image media).
48
+ - Not a defect: Word's "This document contains fields that may refer to
49
+ other files … update the fields?" yes/no prompt on open. It is the
50
+ deliberate `w:updateFields` set by the ToC builder so Word refreshes
51
+ cached ToC page numbers; answering Yes refreshes, No keeps them. It is
52
+ not the corrupt-file dialog.
53
+
54
+ ### Strict OOXML (transitional schema) findings — none Word-blocking
55
+
56
+ Validation against the transitional schema set (uniword `data/schemas`,
57
+ `xmllint`) leaves only tolerated artifacts:
58
+
59
+ 1. `word/settings.xml`: `w:docVars` serialized after `w:rsids` — the
60
+ reconciler anchored `w:rsids` on `w:compat` unconditionally. Fixed
61
+ upstream in metanorma/uniword#127 (anchor on docVars when present).
62
+ 2. `word/styles.xml`: `Heading6` (outlineLvl before spacing, predates the
63
+ repo) and `zzCopyrightaddress` (jc inserted after contextualSpacing by
64
+ 96c49337) violated the CT_PPrBase sequence. Fixed in
65
+ `data/iso-dis/template.docx` on this lane.
66
+ 3. `word/document.xml`: OMML `m:dPr` children serialize as
67
+ `begChr, endChr, sepChr, grow` (sepChr must precede endChr). Plurimath
68
+ `to_omml` emits that order and lutaml-model's ordered mapping preserves
69
+ it through `Omml.parse`. Word renders the construct correctly (verified
70
+ in the same open). Write-up for the owner; plurimath/omml are outside
71
+ the auto-file org list.
72
+ 4. The remaining `mc:Ignorable`-attribute and `w14:`/`w15:`/`w16cid:`
73
+ extension-attribute "errors" are xmllint MCE limitations; Word's own
74
+ files carry the same constructs.
75
+
@@ -0,0 +1,48 @@
1
+ # 088b: Figures clipped to a sliver by the Normal exact line rule
2
+
3
+ ## Status: DONE (fixed on lane/1728-p0-wordopen, 2026-12-02)
4
+
5
+ ## Symptom
6
+
7
+ User reports DOCX figures "not properly showing, only showing some half or
8
+ not showing" — inline figure images render as a thin sliver (the bottom
9
+ edge only) above the caption; some figures appear almost entirely missing.
10
+
11
+ ## Root cause
12
+
13
+ The DIS template's `Normal` style carries
14
+ `<w:spacing w:after="160" w:line="249" w:lineRule="exact"/>`. The
15
+ `FigureGraphic` style (based on `BaseText`, which does not override the
16
+ line rule) inherits that EXACT 249-twip line height, and Word (and
17
+ LibreOffice) clip inline drawings to the fixed line height. A figure
18
+ 2.5in tall in a 249-twip line shows only the bottom ~0.17in.
19
+
20
+ Evidence:
21
+ - All five drawings in the DIS-fixture output are `wp:inline` in
22
+ `FigureGraphic` paragraphs with no direct spacing override.
23
+ - The emitted extents match the source pixel aspect ratios exactly, so
24
+ sizing was never the problem — clipping was.
25
+ - The DOC baseline renders the same figures full-height: its figure
26
+ paragraphs carry `class="figure"` with no line-height constraint.
27
+ - A/B LibreOffice render of the fixture output before/after the fix:
28
+ pre-fix Figure A.1 is a sliver and Figure C.2 subfigures are bottom
29
+ arcs; post-fix both render complete (page count moves 20 → 21).
30
+ - User observed the clipping on the same artifact opened in Microsoft
31
+ Word; Word truncated identically.
32
+
33
+ ## Fix
34
+
35
+ - `data/iso-dis/template.docx` `FigureGraphic` spacing gains
36
+ `w:line="240" w:lineRule="auto"` (single spacing, line grows to the
37
+ image height). `Normal`'s exact 249 rule is untouched so body-text
38
+ layout parity with the DOC baseline is preserved.
39
+ - `data/iso-dis/styles.yml` mirrors the FigureGraphic spacing.
40
+
41
+ ## Verification (2026-12-02)
42
+
43
+ - Re-rendered DIS fixture: emitted `word/styles.xml` carries
44
+ `<w:spacing w:before="240" w:after="120" w:line="240" w:lineRule="auto"/>`
45
+ on `FigureGraphic`.
46
+ - LibreOffice A/B: figures render complete in the post-fix output.
47
+ - Style specs green (style_mapping, style_resolver, integrity,
48
+ template_provenance — 144 examples).
@@ -4,7 +4,7 @@
4
4
 
5
5
  Comparing elements found in reference STS XML vs sts-ruby model classes.
6
6
 
7
- Status: 16 "Verify mapping" rows checked against sts-ruby origin/main (8279d6b): 14 mapped, 2 gaps (`target`, `named-content` in `Paragraph`).
7
+ Status: 16 "Verify mapping" rows checked against sts-ruby origin/main (8279d6b): 14 mapped, 2 gaps (`target`, `named-content` in `Paragraph`). CLOSED 2026-12-02: both gaps mapped and shipped in sts 0.6.15 (see Status below).
8
8
 
9
9
  ### Front (iso-meta) — Sts::IsoSts::IsoMeta
10
10
 
@@ -145,8 +145,8 @@ Status: 16 "Verify mapping" rows checked against sts-ruby origin/main (8279d6b):
145
145
  | `inline-formula` | `InlineFormula` | Present |
146
146
  | `fn` | `TbxIsoTml::Fn` | Present |
147
147
  | `break` | `Break` | Present |
148
- | `target` | `Target` class exists (lib/sts/iso_sts/target.rb), but not mapped in `Paragraph` (lib/sts/{iso,niso}_sts/paragraph.rb); dropped on round trip | Gap |
149
- | `named-content` | `NamedContent` class exists (lib/sts/iso_sts/named_content.rb), but not mapped in `Paragraph` (lib/sts/{iso,niso}_sts/paragraph.rb); dropped on round trip | Gap |
148
+ | `target` | `Target`, mapped in `Paragraph` (lib/sts/iso_sts/paragraph.rb:88, lib/sts/niso_sts/paragraph.rb:76; sts-ruby commit 7fc8f84, released in sts 0.6.15) | Mapped |
149
+ | `named-content` | `NamedContent`, mapped in `Paragraph` (lib/sts/iso_sts/paragraph.rb:89, lib/sts/niso_sts/paragraph.rb:77; sts-ruby commit 7fc8f84, released in sts 0.6.15) | Mapped |
150
150
  | `graphic` (inline) | `Graphic` | Present |
151
151
  | `mml:math` | `Mathml2::Math` | Present |
152
152
 
@@ -184,3 +184,13 @@ CLOSED on the card's own scope, with one dependency follow-up outside this repo.
184
184
  - The 14 "Mapped" rows: every `lib/sts/...rb:LINE` reference in this card was read in sts-ruby origin/main (da0c5e6) and in the installed sts 0.6.14 gem; all 14 lines are the `map_element` for the named element, in both. Command: `grep -o 'lib/sts/[a-z_/]*\.rb:[0-9]*' <this card> | sort -u`, then `git show origin/main:<file> | sed -n <line>p`.
185
185
  - The 2 gaps (`target`, `named-content` in `Paragraph`): mapped in sts-ruby origin/main (da0c5e6): lib/sts/iso_sts/paragraph.rb:88-89 and lib/sts/niso_sts/paragraph.rb:76-77, commit 7fc8f84. NOT in a release: `git merge-base --is-ancestor 7fc8f84 v0.6.14` fails and `git tag --contains da0c5e6` lists no tag; the installed sts 0.6.14 (the version `metanorma-iso.gemspec` allows, `~> 0.6.14`) has no such mapping and drops both on a round trip: `Sts::IsoSts::Standard.from_xml('<standard><body><sec><p>a <named-content content-type="x">nc</named-content> <target id="t1"/> b</p></sec></body></standard>').to_xml` yields `<p>a b</p>`.
186
186
  - Remaining outside this card: a sts release that includes 7fc8f84, then a dependency bump here (not done: no version bumps in a feature branch). The converter does not emit `target` or `named-content` today, so no output of this repo is affected.
187
+
188
+ ## Status (2026-12-02)
189
+
190
+ DONE. Both mapping gaps shipped and consumed; verification green on both sides.
191
+
192
+ - Mapping: metanorma/sts-ruby PR #73 merged to main (da0c5e6): 7fc8f84 maps `target` + `named-content` inside paragraphs (lib/sts/iso_sts/paragraph.rb:88-89, lib/sts/niso_sts/paragraph.rb:76-77), and 3788bf3 extends both elements to every inline parent the XSDs allow (87 IsoSts/NisoSts classes), fixes repeated `named-content` collapsing in IsoSts Label/Term, and nests content in `NamedContent`.
193
+ - Release: sts 0.6.15 (tag v0.6.15, rubygems 0.6.15 latest, GitHub Release published 2026-11-20 by github-actions[bot]). Released-gem probe: `Sts::IsoSts::Standard` and `Sts::NisoSts::Standard` both keep `<target>` and `<named-content>` on a parse→emit round trip.
194
+ - Consumer: metanorma-iso `5cbb0e1d` ("chore(deps): require sts ~> 0.6.15"), shipped in v3.5.40.
195
+ - Round-trip verdict (fresh clone at origin/main 0a0b137, private reference fixtures restored): 362 examples, 0 failures — 34 reference-doc round trips (17 files) plus the focused specs added with the mapping (322 inline_named_content + 6 paragraph_inline_elements examples).
196
+ - STS-lane verdict (metanorma-iso spec/sts against the released 0.6.15): 730 examples, 0 failures.
@@ -1,6 +1,6 @@
1
1
  # TODO 005: Verify DOCX opens in Word without "unreadable content" error
2
2
 
3
- ## Status: DONE (verified in Microsoft Word, 2026-11-19)
3
+ ## Status: DONE (verified in Microsoft Word, 2026-11-19; re-verified on 3.5.42, 2026-12-02)
4
4
 
5
5
  ## Context
6
6
  All known XML-level fixes have been applied:
@@ -33,3 +33,21 @@ Generated: `data/rice_fixed9.docx`
33
33
  ## Verification (2026-11-19)
34
34
  - rice.presentation.xml rendered to DOCX at ac2393fb (lane/1728-cards-batch4), opened in Microsoft Word read-only: no "unreadable content" or repair dialog.
35
35
  - Table of contents entries clicked in Word jump to their headings.
36
+
37
+ ## Re-verification on the 3.5.42 baseline (2026-12-02)
38
+
39
+ - DIS-fixture DOCX (one-process render, metanorma-iso v3.5.42 worktree,
40
+ see P0-005 for the full gate) opened in Microsoft Word for Mac: no
41
+ "unreadable content" or repair dialog; document opens, OMML math
42
+ renders, file mtime unchanged after close without saving.
43
+ - The only prompt on open is Word's "This document contains fields that
44
+ may refer to other files. Do you want to update the fields in this
45
+ document?" — driven by the deliberate `w:updateFields` from the ToC
46
+ builder so Word refreshes cached ToC page numbers. Not a corruption
47
+ warning; answering either way opens the document.
48
+ - Test-placement caveat for future manual runs: do not open test
49
+ artifacts from `/tmp` — after answering Yes, macOS asks Word to grant
50
+ access to /tmp, which Word cannot. Use a user folder (the baselines
51
+ now live at `~/metanorma/baselines/138-14/`).
52
+ - Figure rendering defect observed on the same artifact is tracked and
53
+ fixed in P1-014.
data/TODO.docx/README.md CHANGED
@@ -4,15 +4,18 @@ Priority-based index of remaining TODOs for the ISO DOCX output pipeline.
4
4
 
5
5
  ## P0 — Critical (Word cannot open the file)
6
6
 
7
- These block Word from opening the generated DOCX. Fix before anything else.
7
+ Status: DONE — the whole cluster is resolved. P0-005 verified in Microsoft
8
+ Word on 2026-11-19 and re-verified on the 3.5.42 baseline on 2026-12-02
9
+ (no "unreadable content" or repair dialog; see the point files for the
10
+ evidence and the residual tolerated-construct notes).
8
11
 
9
12
  | # | Issue | Impact |
10
13
  |---|-------|--------|
11
- | P0-001 | Missing headerReference/footerReference/titlePg in sectPr | Root cause — Word rejects file |
12
- | P0-002 | Detailed sectPr header/footer ref requirements | Same as P0-001, finer breakdown |
13
- | P0-003 | Body sectPr differences vs reference | Structural mismatch |
14
- | P0-004 | Body sectPr structure incomplete | Depends on P0-001 |
15
- | P0-005 | Word reports unreadable content | Symptom of P0-001 through P0-004 |
14
+ | P0-001 | Missing headerReference/footerReference/titlePg in sectPr | status: done |
15
+ | P0-002 | Detailed sectPr header/footer ref requirements | status: done |
16
+ | P0-003 | Body sectPr differences vs reference | status: done |
17
+ | P0-004 | Body sectPr structure incomplete | status: done |
18
+ | P0-005 | Word reports unreadable content | status: done (Word-verified 2026-11-19, re-verified 2026-12-02) |
16
19
 
17
20
  ## P1 — Major Content Issues
18
21
 
@@ -32,7 +35,8 @@ Content is missing or visibly broken in the output.
32
35
  | P1-010 | Normative references formatting | Style and structure issues |
33
36
  | P1-011 | Normative reference footnote markers | Footnote markers in normref |
34
37
  | P1-012 | Normref style and markers combined | Consolidated normref issue |
35
- | P1-013 | Inline math OMML (partial — text fallback) | Inline formulas render as text |
38
+ | P1-013 | Inline math OMML (partial — text fallback) | status: done (block and inline math render as OMML) |
39
+ | P1-014 | Figures clipped to a sliver by Normal's exact line rule | status: done (FigureGraphic line rule fixed 2026-12-02) |
36
40
 
37
41
  ## P2 — Formatting and Styling
38
42
 
@@ -69,7 +73,7 @@ Missing features or test coverage, but output is usable.
69
73
  | P3-004 | STS missing standalone transformers | cross_ref, bib_ref, terms_section, annex, bibliography |
70
74
  | P3-005 | End-to-end rice output spec (tagged :slow) | Not in default CI |
71
75
  | P3-006 | Amendment doctype awareness | No amendment-specific rendering |
72
- | P3-007 | Verify Word opens (manual test) | Superseded by P0 fixes |
76
+ | P3-007 | Verify Word opens (manual test) | status: done (Word-verified 2026-11-19, re-verified 2026-12-02) |
73
77
  | P3-008 | Architecture root-cause fixes (Phase 2/3) | Assembly refactoring |
74
78
 
75
79
  ## REF — Reference Documents
@@ -1363,6 +1363,8 @@ style_library:
1363
1363
  spacing:
1364
1364
  before: '240'
1365
1365
  after: '120'
1366
+ line: '240'
1367
+ line_rule: 'auto'
1366
1368
  alignment: center
1367
1369
  keep_next: true
1368
1370
  keep_lines: false
Binary file
@@ -75,18 +75,22 @@ module IsoDoc
75
75
  close_field: index == entries.size - 1)
76
76
  end
77
77
 
78
- request_field_refresh(doc)
78
+ # No w:updateFields flag in word/settings.xml (owner ruling).
79
+ # The flag used to be set here so Word recomputed the ToC on
80
+ # open, but Word auto-evaluates PAGEREF fields during its
81
+ # on-open pagination with or without the flag, so the flag
82
+ # bought nothing except the "This document contains fields
83
+ # that may refer to other files" prompt on every open. The
84
+ # cached page numbers remain placeholders — the documented
85
+ # tradeoff for DOCX-only compiles, where no pagination data
86
+ # exists until a layout engine runs. When the PDF leg is
87
+ # requested, a future enhancement may bake the harvested
88
+ # numbers into the cached results, but the mechanism must
89
+ # never depend on it.
79
90
  end
80
91
 
81
92
  private
82
93
 
83
- # The cached page numbers are placeholders; w:updateFields makes
84
- # Word recompute them (and the TOC) when the document is opened.
85
- def request_field_refresh(doc)
86
- doc.model.settings ||= Uniword::Wordprocessingml::Settings.new
87
- doc.model.settings.update_fields = Uniword::Wordprocessingml::UpdateFields.new
88
- end
89
-
90
94
  def render_toc_heading(model, doc)
91
95
  para = Uniword::Builder::ParagraphBuilder.new
92
96
  para.style = @resolver.paragraph_style(:contents_title)
@@ -311,10 +315,11 @@ module IsoDoc
311
315
  render_toc_heading_text(entry.source, runs)
312
316
  append_tab(runs)
313
317
 
314
- # PAGEREF field with a placeholder result: the static result
315
- # is "1" until Word refreshes the fields (w:updateFields, see
316
- # request_field_refresh), when the entry's bookmark yields the
317
- # real page number.
318
+ # PAGEREF field with a placeholder result: the static result is
319
+ # "1" until Word refreshes the field. Word auto-evaluates
320
+ # PAGEREF during its on-open pagination (no w:updateFields
321
+ # flag is set — see render for the ruling), so the entry's
322
+ # bookmark yields the real page number on open.
318
323
  runs << field_char_run("begin")
319
324
  runs << instr_text_run(" PAGEREF #{entry.bookmark_name} \\h ")
320
325
  runs << field_char_run("separate")
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iso
3
- VERSION = "3.5.42".freeze
3
+ VERSION = "3.5.44".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.42
4
+ version: 3.5.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -409,6 +409,7 @@ files:
409
409
  - TODO.docx/P1-011-normref-footnote-markers.md
410
410
  - TODO.docx/P1-012-normref-style-and-markers.md
411
411
  - TODO.docx/P1-013-inline-math-omml.md
412
+ - TODO.docx/P1-014-figure-line-clipping.md
412
413
  - TODO.docx/P2-001-character-styles-gap.md
413
414
  - TODO.docx/P2-002-style-alignment-gaps.md
414
415
  - TODO.docx/P2-003-missing-rstyles.md