metanorma-iso 3.5.24 → 3.5.25

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: cea49df0b954050b576b5fa40bf4dd85cc93fd5327156656b600de0b3c093a66
4
- data.tar.gz: fec01b933a9129ec8bb942330ef76f1c30dd7a761fa40e81685f6a11cef9291a
3
+ metadata.gz: 768bb7c02360bd80725d6a9ce3e175e92766867e032cc5fea7bdec0190eaeb63
4
+ data.tar.gz: 42684cefc453fc51bd23809fa8a942319a471633fd19265dd002e1861d9e52ff
5
5
  SHA512:
6
- metadata.gz: 879b813d0278e54ba6001cb4da7fc6940933570f61b8cb93d79669a20bbc08b577f2ece5ef171f1c06ea289bf772497d5a4fb43f160fa529a612a8994a14a699
7
- data.tar.gz: fa31285ceccfd3c044ada39a5cc371403dd7185ec0b6361b37aeabbeae3a55372f1420284d165c4b8e5a966266acbafdaf763cf42377b3f9de56f91ffe7b2270
6
+ metadata.gz: e008a160695feec182265d2d0d6b3207de9d17d6a5506de4f66c944a0043c8b77d86fd658c8ad03e3269a817a8fcca587d577c92f5244209826ab1b243288463
7
+ data.tar.gz: 1194f4662e705e1069682108c013961130853fc3598aa9f1499897b76db418fb4fca66d1b2dae2a0c92561237e6cdf87c77555a27a1a581891c84e8325e2d83b
@@ -566,9 +566,23 @@ module IsoDoc
566
566
  is_normative = refs_sect.normative.to_s == "true"
567
567
  @context.with_normative(is_normative) do
568
568
  walk_mixed_content(refs_sect, doc)
569
+ render_section_admonitions(refs_sect, doc)
569
570
  end
570
571
  end
571
572
 
573
+ # Admonition children of the references section (e.g. an `[EDITOR]`
574
+ # editorial note following the reference list) render after the
575
+ # walked content — 1.17.0 carried them ("EDITORIAL NOTE — …").
576
+ # The section model is unordered, so the fallback walk cannot place
577
+ # them by document order; they are dispatched explicitly here once
578
+ # the model carries them (StandardReferencesSection admonition
579
+ # mapping, metanorma-iso#1764).
580
+ def render_section_admonitions(refs_sect, doc)
581
+ return unless refs_sect.class.attributes.key?(:admonition)
582
+
583
+ Array(refs_sect.admonition).each { |admonition| dispatch(admonition, doc) }
584
+ end
585
+
572
586
  # ── Block visitors (central dispatch) ──────────────────────────
573
587
  #
574
588
  # Class-keyed dispatch via the Renderers::Registry. Each content
@@ -341,7 +341,20 @@ module IsoDoc
341
341
  text = stem_math_text(element)
342
342
  return text if text && !text.empty?
343
343
 
344
- collect_text(element)
344
+ text = collect_text(element)
345
+ return text if text && !text.empty?
346
+
347
+ # Presentation bare-number stems carry no MathML at all:
348
+ # mnconvert emits the digit as plain text inside the semx
349
+ # wrapper ("0<latexmath>0</latexmath>"), so the text only
350
+ # reachable through the semx child is the stem's content
351
+ # (isodoc#898: stem:[0]/stem:[1] vanished from table cells).
352
+ Array(attribute_value(element, :semx)).each do |child|
353
+ text = collect_text(child)
354
+ return text if text && !text.empty?
355
+ end
356
+
357
+ ""
345
358
  end
346
359
 
347
360
  # AsciiMath is the plain-text form of an inline symbol. The
@@ -16,6 +16,7 @@ module IsoDoc
16
16
  include Base
17
17
 
18
18
  def render(element, para)
19
+ return if render_number_as_text(element, para)
19
20
  return if render_as_omml(element, para)
20
21
 
21
22
  render_as_text(element, para)
@@ -23,6 +24,18 @@ module IsoDoc
23
24
 
24
25
  private
25
26
 
27
+ # 1.17.0 parity: a stem consisting of a bare number renders as
28
+ # a plain text run — an OMML object for a bare digit reads as
29
+ # math styling inside prose and table cells (metanorma-iso#1764).
30
+ # Returns true when the paragraph received the number.
31
+ def render_number_as_text(element, para)
32
+ digits = parent.number_only_stem_text(element)
33
+ return false unless digits
34
+
35
+ parent.add_text(para, digits)
36
+ true
37
+ end
38
+
26
39
  # Append the stem's MathML as inline OMML equation models.
27
40
  # Returns true when the paragraph received the equation.
28
41
  def render_as_omml(element, para)
@@ -67,6 +67,28 @@ module IsoDoc
67
67
  nil
68
68
  end
69
69
 
70
+ # 1.17.0 parity: a stem whose MathML is a bare number renders as
71
+ # plain text, not as an equation object. Returns the digits when
72
+ # the MathML carries exactly one <mn> with a digits-only payload
73
+ # and no other MathML elements beyond the math/semantics/mrow
74
+ # wrappers, nil otherwise.
75
+ def number_only_stem_text(stem)
76
+ mathml = stem_mathml(stem)
77
+ return nil unless mathml.to_s.include?("<mn")
78
+
79
+ digits = mathml.scan(%r{<mn[^>]*>([^<]*)</mn>}).flatten.join.strip
80
+ return nil unless digits.match?(/\A\d+\z/)
81
+ return nil unless mathml.scan(/<mn[\s>]/).length == 1
82
+
83
+ wrappers = mathml.gsub(%r{<mn[^>]*>[^<]*</mn>}, "")
84
+ .scan(/<([a-zA-Z]+)[\s>]/).flatten
85
+ return nil unless wrappers.all? { |tag| %w[math semantics mrow].include?(tag) }
86
+
87
+ digits
88
+ rescue StandardError
89
+ nil
90
+ end
91
+
70
92
  private
71
93
 
72
94
  # Direct :math attribute (semantic stem), then <semx>-wrapped
@@ -24,6 +24,7 @@ module IsoDoc
24
24
  render_heading(section, doc)
25
25
  render_intro(section, doc)
26
26
  render_bibitems(section, doc)
27
+ render_admonitions(section, doc)
27
28
  end
28
29
  end
29
30
  end
@@ -65,6 +66,19 @@ module IsoDoc
65
66
  @walker.dispatch(bib, doc)
66
67
  end
67
68
  end
69
+
70
+ # Admonition children of the references section (e.g. an
71
+ # `[EDITOR]` editorial note following the reference list) render
72
+ # after the entries — 1.17.0 carried them ("EDITORIAL NOTE — …");
73
+ # the model dropped them at ingest until the section gained the
74
+ # admonition mapping (metanorma-iso#1764).
75
+ def render_admonitions(section, doc)
76
+ return unless section.class.attributes.key?(:admonition)
77
+
78
+ Array(section.admonition).each do |admonition|
79
+ @walker.dispatch(admonition, doc)
80
+ end
81
+ end
68
82
  end
69
83
  end
70
84
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Iso
3
- VERSION = "3.5.24".freeze
3
+ VERSION = "3.5.25".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.24
4
+ version: 3.5.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-17 00:00:00.000000000 Z
11
+ date: 2026-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-document