metanorma-utils 1.10.3 → 1.11.0

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.

Potentially problematic release.


This version of metanorma-utils might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1529d7af0a046a40b3b079adbc36786882be1abce4b515b2ec644c9ade8fb6eb
4
- data.tar.gz: 756653fafb5a833206d2f60e7cbcc64c8c0f7dc2d94149655efbd06395694be7
3
+ metadata.gz: 3d20b8cee0b06766e6832c5751087c03147e751b034a6b9c4c5f503cc72035f3
4
+ data.tar.gz: 9fce9d155961bf671181f497f6922e2e04ab2b758fa96f3db496bcbab620eefb
5
5
  SHA512:
6
- metadata.gz: f62f4879f665181f06d1102785dac3e8481cd4d15c9e982c481af56bd079a4440205a7d18549dd1b53ed0c8bc127119742904b088e145ee4f0710f5745b129da
7
- data.tar.gz: 8234bac72f1dd5f432af91442c3802a2c03f3ba7f928ef89c2feba5c5a6838176fd2d271f2beb63a70a0c613b24d94a5b6816e594e40c7851070f1125b336716
6
+ metadata.gz: 2a383dfa442ef5b6915a226a0865b9ec6f65aaf60a404f8a0e70c7e8d2482f8ea4e08bd4172c628db359711882e9a7f3df0e1ef66b1e99683f326cc300aa294e
7
+ data.tar.gz: 030a5f340137c076344da6d7172fa1092bb24f2d1c6985fe0683b64ce875c708687107ac3f2e3aa4cbb4876a0c3f34a9ea2874688f92cbcab8d2cf394fb378e7
data/lib/utils/log.rb CHANGED
@@ -86,7 +86,7 @@ module Metanorma
86
86
  while !node.nil? && node["id"].nil? && node.respond_to?(:parent)
87
87
  node = node.parent
88
88
  end
89
- node.respond_to?(:parent) ? "ID #{node['id']}" : ""
89
+ node.respond_to?(:parent) ? "ID #{node['anchor'] || node['id']}" : ""
90
90
  elsif node.is_a? String then node
91
91
  elsif node.respond_to?(:lineno) && !node.lineno.nil? &&
92
92
  !node.lineno.empty?
@@ -224,7 +224,7 @@ module Metanorma
224
224
  /^ID /.match?(loc) or return [loc, nil]
225
225
  loc.sub!(/^ID /, "")
226
226
  loc = @mapid[loc] while @mapid[loc]
227
- url = "#{@htmlfilename}##{loc}"
227
+ url = "#{@htmlfilename}##{to_ncname loc}"
228
228
  [loc, url]
229
229
  end
230
230
 
data/lib/utils/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Utils
3
- VERSION = "1.10.3".freeze
3
+ VERSION = "1.11.0".freeze
4
4
  end
5
5
  end
data/lib/utils/xml.rb CHANGED
@@ -69,7 +69,7 @@ module Metanorma
69
69
  cjk2 = /#{CJK}/o.match?(nextfirst)
70
70
  text1 = /[^\p{Z}\p{C}]/.match?(last)
71
71
  text2 = /[^\p{Z}\p{C}]/.match?(nextfirst)
72
- (cjk1 && (cjk2 || !text2)) and next
72
+ cjk1 && (cjk2 || !text2) and next
73
73
  !text1 && cjk2 and next
74
74
  ret[i] += " "
75
75
  end
@@ -125,10 +125,18 @@ module Metanorma
125
125
  end
126
126
 
127
127
  # all element/attribute pairs that are ID anchors in Metanorma
128
- def anchor_attributes
129
- [%w[* id], %w[* bibitemid], %w[review from],
130
- %w[review to], %w[index to], %w[xref target],
131
- %w[callout target], %w[location target]]
128
+ def anchor_attributes(presxml: false)
129
+ ret = [%w(review from), %w(review to), %w(callout target), %w(xref to),
130
+ %w(eref bibitemid), %w(citation bibitemid), %w(xref target),
131
+ %w(label for), %w(location target), %w(index to),
132
+ %w(termsource bibitemid), %w(admonition target)]
133
+ ret1 = [%w(fn target), %w(semx source), %w(fmt-title source),
134
+ %w(fmt-xref to), %w(fmt-xref target), %w(fmt-eref bibitemid),
135
+ %w(fmt-xref-label container), %w(fmt-fn-body target),
136
+ %w(fmt-review-start source), %w(fmt-review-start end),
137
+ %w(fmt-review-start target), %w(fmt-review-end source),
138
+ %w(fmt-review-end start), %w(fmt-review-end target)]
139
+ presxml ? ret + ret1 : ret
132
140
  end
133
141
 
134
142
  # convert definition list term/value pair into Nokogiri XML attribute
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.3
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-14 00:00:00.000000000 Z
11
+ date: 2025-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor