isodoc-i18n 1.5.2 → 1.5.3

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: 5323ffdd11fbc3590df89e847850d94952dd14dbedc9a3890f816452c74e5bad
4
- data.tar.gz: 8de0b46ebe7acfd0e5d63835462f01c672ac6f1a915926b98395ad47b5801a81
3
+ metadata.gz: 6501239186bf5665f96df990867a1a6ba68e4bb86dcd50d16bb76f263553c152
4
+ data.tar.gz: db50bbd890fd8032fed107b91a893dd3ae11719c5e95fef8c7b419bcf57fb568
5
5
  SHA512:
6
- metadata.gz: 9a0c53b89c58f7d898955ed3ad725c5d38d10452787436b52e25a8dca493e6bc33aff19087ce0470098cdffaf52c71df7fdbb5c1eaea488eb96ff576987e470e
7
- data.tar.gz: 27536a6ebf32c1dafca0da5db856c3215bad6a3a81b1314205a83337290c04bdbca13f75f3d27232085817913152af59072c88a4dfd1fc7a4cd503858d1078c2
6
+ metadata.gz: 52af766969ed595f51030752c9e941be16e7866319db076906f6c8bfdc49c796fa8a3edc938a2cd2720e8d018dda4288656c8d1c4ac0d28c3755ca25a170daab
7
+ data.tar.gz: 12dc30aef9c2c407b0fcd95d58caf2f5799e4db19e7b760dbf0ffbcbc9a350c153a356003088a57e6d5f1d8d73005f8f9d87f2699dddf8f01a952e98cbecfc25
data/.rubocop.yml CHANGED
@@ -1,10 +1,10 @@
1
1
  # Auto-generated by Cimas: Do not edit it manually!
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
4
- - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
5
5
 
6
6
  # local repo-specific modifications
7
7
  # ...
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 3.4
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
2
  class I18n
3
- VERSION = "1.5.2".freeze
3
+ VERSION = "1.5.3".freeze
4
4
  end
5
5
  end
data/lib/isodoc/l10n.rb CHANGED
@@ -41,6 +41,7 @@ module IsoDoc
41
41
 
42
42
  def l10n_prep(text, options)
43
43
  xml = Nokogiri::XML::DocumentFragment.parse(text)
44
+ wrap_tt_children_in_esc(xml)
44
45
  t = xml.xpath(".//text()").reject { |node| node.text.empty? }
45
46
  text_cache = build_text_cache(t, options[:prev], options[:foll])
46
47
 
@@ -51,6 +52,19 @@ module IsoDoc
51
52
  [t, text_cache, xml, options[:prev], options[:foll], esc_indices]
52
53
  end
53
54
 
55
+ # <tt> is an inline code element whose content is by definition Latin /
56
+ # literal — it must not undergo punctuation localisation. Wrap its
57
+ # children in <esc> so build_esc_indices skips them; the trailing
58
+ # <esc>-strip in l10n removes the wrapper afterwards.
59
+ def wrap_tt_children_in_esc(xml)
60
+ xml.xpath(".//tt | .//*[local-name()='tt']").each do |tt|
61
+ next if tt.children.empty?
62
+ next if tt.children.all? { |c| c.element? && c.name == "esc" }
63
+
64
+ tt.inner_html = "<esc>#{tt.inner_html}</esc>"
65
+ end
66
+ end
67
+
54
68
  # Build set of indices for text nodes within <esc> tags
55
69
  # Handles both namespaced and non-namespaced <esc> elements
56
70
  def build_esc_indices(xml, text_nodes)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-12 00:00:00.000000000 Z
11
+ date: 2026-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64