metanorma-document 0.2.9 → 0.2.13

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: da12347749776b99b68dcc3816de625289ce2e56f51a9716c05d38088a4913b7
4
- data.tar.gz: 2bf0989d205c0ab6a0c282fd5c4cab7d0c7deaccf012baafc64fa97c9160029f
3
+ metadata.gz: b70dbe97dadd0576e3ae226eb4e66ad7112b1e2876b9865ed070035d8d6a89e9
4
+ data.tar.gz: 2a843d047f3cbe4872e3416e7f66cf4d8077295f1016453f409056d6e3c93894
5
5
  SHA512:
6
- metadata.gz: 1af9848d0640195e2176378b067214afe02f1da504893ed09686625e0a79f637bfad69fa5575d0959b59d31e78eff2b986dcdb42d63169db853ab808fb52bf22
7
- data.tar.gz: 8dd05a2a8ed9344e5d70a35ab3c4653ec9b4c69dc001ef3cd400c6822b4874b8582304df5eee0798f37f8da43388e90fc71dbd88402d41fc1e401cd95fcd396a
6
+ metadata.gz: 737da4c9acc3fcf9be5ea0a02673a9969f481cbad496174334f5ee6360679f0d331d8df7de5a33c9805fd71ba382f3d3a6c9c6137bc6501b9c0c5846d2da1535
7
+ data.tar.gz: 657aa49800f8112eb249b433f96d1408be47e7bc633b26b3e270991ecf22b71d372e5947b1eb6a8736b0206f542447a8e00f41476ca594683eede493035db1e5
data/CHANGELOG.md CHANGED
@@ -13,6 +13,7 @@
13
13
 
14
14
  ### Fixed
15
15
 
16
+ - `Moxml::Adapter::Nokogiri.children` override accepts the `entity_bearing:` keyword of moxml 0.5.36 and later (#66)
16
17
  - Roundtrip fidelity: missing attributes, model corrections, and Canon config alignment
17
18
  - Stale `Semantic::Root` reference in rake task
18
19
 
data/Gemfile CHANGED
@@ -5,11 +5,15 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in metanorma-standoc-document.gemspec
6
6
  gemspec
7
7
 
8
+ # The 0.2.x maintenance line serves the metanorma-cli 0.2.x bundle,
9
+ # whose relaton keeps rubyzip ~> 2.3 and therefore resolves
10
+ # lutaml-model below 0.8.31 (0.8.31+ needs rubyzip ~> 3.4). Released
11
+ # gems only: the upstream main branches move past this line.
8
12
  if ENV["CI"]
9
- gem "canon", github: "lutaml/canon", branch: "main"
10
- gem "lutaml-model", github: "lutaml/lutaml-model", branch: "main"
11
- gem "mml", github: "plurimath/mml", branch: "main"
12
- gem "moxml", github: "lutaml/moxml", branch: "main"
13
+ gem "canon"
14
+ gem "lutaml-model", "~> 0.8.0", "< 0.8.31"
15
+ gem "mml", "~> 2.4"
16
+ gem "moxml", "~> 0.5.0"
13
17
  else
14
18
  gem "canon", path: "../../lutaml/canon"
15
19
  gem "lutaml-model", path: "../../lutaml/lutaml-model"
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Metanorma
4
4
  module Document
5
- VERSION = "0.2.9"
5
+ VERSION = "0.2.13"
6
6
  Version = VERSION
7
7
  end
8
8
  end
@@ -18,7 +18,9 @@ module Metanorma
18
18
  remove_method :children
19
19
  end
20
20
 
21
- def self.children(node)
21
+ # moxml 0.5.36+ passes `entity_bearing:`. The Nokogiri adapter
22
+ # does not use it, so accept it and ignore it.
23
+ def self.children(node, **)
22
24
  node.children.to_a
23
25
  end
24
26
  end
@@ -54,12 +54,29 @@ module Metanorma
54
54
  # Provides `blocks` method for ordered-content section types.
55
55
  # Returns child nodes in document order via `each_mixed_content`.
56
56
  module OrderedContent
57
+ # Section metadata mapped by SectionXmlMapping (title machinery
58
+ # and annotation markers) precedes the content alternation in
59
+ # the grammar — `blocks` answers content children only.
60
+ SECTION_METADATA_ELEMENTS = [
61
+ Metanorma::Document::Components::Inline::TitleWithAnnotationElement,
62
+ Metanorma::Document::Components::Inline::VariantTitleElement,
63
+ Metanorma::Document::Components::Inline::FmtTitleElement,
64
+ Metanorma::Document::Components::Inline::FmtXrefLabelElement,
65
+ Metanorma::Document::Components::Inline::FmtAnnotationStartElement,
66
+ Metanorma::Document::Components::Inline::FmtAnnotationEndElement,
67
+ ].freeze
68
+
57
69
  def blocks
58
70
  @blocks ||=
59
71
  begin
60
72
  result = []
61
73
  each_mixed_content do |node|
62
- result << node unless node.is_a?(String)
74
+ next if node.is_a?(String)
75
+ next if SECTION_METADATA_ELEMENTS.any? do |klass|
76
+ node.is_a?(klass)
77
+ end
78
+
79
+ result << node
63
80
  end
64
81
  result
65
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-document
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.13
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-05-22 00:00:00.000000000 Z
11
+ date: 2026-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model