isodoc 2.1.5 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0dec55aba65a594c5a4ef3916219976edb11e162aee6f806f05bc587466941a
4
- data.tar.gz: 47ef329be8d9b6aff1777820aa4901a74400888196227ea5dc08a218793e6f87
3
+ metadata.gz: c60f8eb9fcf49c289d99f64d901511387ae9d928a93c20ec81c011eb536f8a6a
4
+ data.tar.gz: f4c33c72526c543b3d7c4929a20dfaa2413e9d007b8d2315aed424e156ad4061
5
5
  SHA512:
6
- metadata.gz: fd9d0f72fdef518808f6605953fa11d6033c5693a8851807b617bacc0d43315657ed80b8de93f0f46bcfb9d0529f327d647e00947234c5ebefa8666250b57ea9
7
- data.tar.gz: 3ef2cc2b5f97c2358e5e888865c8406ce66808e3fb7e62804646b71838ad748e372880ce359648dadd581bc36205e6d347aedbe220f2c9d6a1a7f5ee130d8055
6
+ metadata.gz: bd64d2a35ac86b7b70d46b4ea3631070291b32ee014199d1bc395c5bf33c130d41527afcce573fddd49dc96a4f97d77a6e21a81ed45afec325ce2da61ad4c6ed
7
+ data.tar.gz: 758249109707c1a6132311e2706f9b791799960f063546cdc8d125f36919845e03bfc5546d2a68d47c30f782fd20b3de1143e66e88a53b5b5bb766e52407a2a7
@@ -15,8 +15,8 @@ module IsoDoc
15
15
  def ns(xpath)
16
16
  xpath.gsub(%r{/([a-zA-z])}, "/xmlns:\\1")
17
17
  .gsub(%r{::([a-zA-z])}, "::xmlns:\\1")
18
- .gsub(%r{\[([a-zA-z][a-z0-9A-Z@/]* ?=)}, "[xmlns:\\1")
19
- .gsub(%r{\[([a-zA-z][a-z0-9A-Z@/]*[/\[\]])}, "[xmlns:\\1")
18
+ .gsub(%r{\[([a-zA-z][a-z0-9A-Z@/-]* ?=)}, "[xmlns:\\1")
19
+ .gsub(%r{\[([a-zA-z][a-z0-9A-Z@/-]*[/\[\]])}, "[xmlns:\\1")
20
20
  end
21
21
 
22
22
  def liquid(doc)
@@ -17,7 +17,13 @@ module IsoDoc
17
17
  def location_parse(node, out); end
18
18
 
19
19
  def span_parse(node, out)
20
- node.children.each { |n| parse(n, out) }
20
+ if node["style"]
21
+ out.span **{ style: node["style"] } do |s|
22
+ node.children.each { |n| parse(n, s) }
23
+ end
24
+ else
25
+ node.children.each { |n| parse(n, out) }
26
+ end
21
27
  end
22
28
 
23
29
  def callout_parse(node, out)
@@ -57,12 +63,11 @@ module IsoDoc
57
63
  def eref_url(bibitemid)
58
64
  return nil if @bibitems.nil? || @bibitems[bibitemid].nil?
59
65
 
60
- if url = @bibitems[bibitemid].at(ns("./uri[@type = 'citation']"))
61
- url.text
62
- elsif @bibitems[bibitemid]["hidden"] == "true"
63
- @bibitems[bibitemid]&.at(ns("./uri"))&.text
64
- else "##{bibitemid}"
65
- end
66
+ url = @bibitems[bibitemid].at(ns("./uri[@type = 'citation']")) and
67
+ return url.text
68
+ @bibitems[bibitemid]["hidden"] == "true" and
69
+ return @bibitems[bibitemid].at(ns("./uri"))&.text
70
+ "##{bibitemid}"
66
71
  end
67
72
 
68
73
  def eref_parse(node, out)
@@ -5,15 +5,15 @@ module IsoDoc
5
5
  "."
6
6
  end
7
7
 
8
- def clausedelimspace(out)
8
+ def clausedelimspace(_node, out)
9
9
  insert_tab(out, 1)
10
10
  end
11
11
 
12
- def inline_header_title(out, _node, title)
12
+ def inline_header_title(out, node, title)
13
13
  out.span **{ class: "zzMoveToFollowing" } do |s|
14
14
  s.b do |b|
15
15
  title&.children&.each { |c2| parse(c2, b) }
16
- clausedelimspace(out) if /\S/.match?(title&.text)
16
+ clausedelimspace(node, out) if /\S/.match?(title&.text)
17
17
  end
18
18
  end
19
19
  end
@@ -218,7 +218,7 @@ module IsoDoc
218
218
  when "feedback-statement" then feedback_parse(node, out)
219
219
  when "passthrough" then passthrough_parse(node, out)
220
220
  when "amend" then amend_parse(node, out)
221
- when "tab" then clausedelimspace(out) # in Presentation XML only
221
+ when "tab" then clausedelimspace(node, out) # in Presentation XML only
222
222
  when "svg" then svg_parse(node, out) # in Presentation XML only
223
223
  when "add" then add_parse(node, out)
224
224
  when "del" then del_parse(node, out)
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "2.1.5".freeze
2
+ VERSION = "2.2.0".freeze
3
3
  end
@@ -98,7 +98,7 @@ module IsoDoc
98
98
  docxml.xpath("//p[@class='Biblio']//span[@style='mso-tab-count:1']")
99
99
  .each do |s|
100
100
  s.next.text? or next
101
- s.next.replace(s.next.text.sub(/^\s+/, ""))
101
+ s.next.replace(@c.encode(s.next.text.sub(/^\s+/, ""), :hexadecimal))
102
102
  end
103
103
  end
104
104
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.5
4
+ version: 2.2.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: 2022-07-18 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath