metanorma-standoc 2.1.0 → 2.1.1

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: 1e7285f74dd3b2b9ab155b8bf7e334aeb45f453a20f1d4eaf94f39f42b9251d3
4
- data.tar.gz: fdbad7c4cd96de56faacf360fdedaa0a0a5d24313c34b68ec2ab8e152db6a7c2
3
+ metadata.gz: d2c3089664934dc34b5f41b7e03a7bc2d2b1060e17decafb29dfc1f36fb7bed0
4
+ data.tar.gz: 7ecc333b2847252e7965be128c701f4cb2241d148179cd43b66a9f5cd2a2e108
5
5
  SHA512:
6
- metadata.gz: ce9033847b44804a9ba150db5e4840e1d3dafef077a9c5af52defd74321333c66a3053abc589ae02ee3c28d6fe42afbd568cdef8b1a529e5b2a97ea46ec95ae0
7
- data.tar.gz: 6f498786e8222646f72fe88193797b0b0a23c30d1478cf78fad27862f19ece9c054ebe72c891ad671f5c03b4c8f06a659195cc77f359f517b1ffea02203ad22b
6
+ metadata.gz: 5308c4354dc5fd14e1d5d18dc32e7b52d81ba492e53381771e7dfecea4c83af0bd73387af2bfb6c913687352eaad85c44ded592e1c95179d5d41b3974bc923ff
7
+ data.tar.gz: ba8122c376d231eb6f1f4f4ea235b608b4dd1769394a899fe9fcd6f5bee011f2384cf1455fae0d86d32648e37aee080c0db18755d4a761e793ad5164b500ce61
@@ -53,7 +53,7 @@ module Metanorma
53
53
  permission).include?(text.name))) ||
54
54
  (text.text.strip.empty? && !text.at(".//xref | .//eref | .//link"))
55
55
 
56
- t = Nokogiri::XML::Element.new("description", reqt)
56
+ t = Nokogiri::XML::Element.new("description", reqt.document)
57
57
  text.before(t)
58
58
  t.children = text.remove
59
59
  end
@@ -79,7 +79,8 @@ module Metanorma
79
79
  end
80
80
 
81
81
  def inline_anchor_bibref(node)
82
- eref_contents = (node.text || node.target || node.id)
82
+ eref_contents = HTMLEntities.new
83
+ .decode(node.text || node.target || node.id)
83
84
  &.sub(/^\[?([^\[\]]+?)\]?$/, "[\\1]")
84
85
  @refids << (node.target || node.id)
85
86
  noko do |xml|
@@ -130,7 +130,7 @@ module Metanorma
130
130
 
131
131
  def process(parent, target, attrs)
132
132
  out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
133
- %{<autonumber type=#{target}>#{out}</autonumber>}
133
+ %{<autonumber type='#{target}'>#{out}</autonumber>}
134
134
  end
135
135
  end
136
136
 
@@ -143,9 +143,9 @@ module Metanorma
143
143
  /^(?<lang>[^-]*)(?:-(?<script>.*))?$/ =~ target
144
144
  out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
145
145
  if script
146
- %{<variant lang=#{lang} script=#{script}>#{out}</variant>}
146
+ %{<variant lang='#{lang}' script='#{script}'>#{out}</variant>}
147
147
  else
148
- %{<variant lang=#{lang}>#{out}</variant>}
148
+ %{<variant lang='#{lang}'>#{out}</variant>}
149
149
  end
150
150
  end
151
151
  end
@@ -56,7 +56,7 @@ module Metanorma
56
56
  m = %w(disabled value)
57
57
  .map { |a| attr[a] ? " #{a}='#{attr[a]}'" : nil }.compact
58
58
  out = Asciidoctor::Inline.new(parent, :quoted, attr["text"]).convert
59
- %{<option #{m.join}">#{out}</option>}
59
+ %{<option #{m.join}>#{out}</option>}
60
60
  end
61
61
  end
62
62
  end
@@ -64,14 +64,16 @@ module Metanorma
64
64
  def requirement_elems(node, out)
65
65
  node.title and out.title { |t| t << node.title }
66
66
  a = node.attr("label") and out.label do |l|
67
- l << a
67
+ l << out.text(a)
68
68
  end
69
69
  a = node.attr("subject") and csv_split(a)&.each do |subj|
70
- out.subject { |s| s << subj }
70
+ out.subject { |s| s << out.text(subj) }
71
71
  end
72
72
  a = HTMLEntities.new.decode(node.attr("inherit")) and
73
73
  csv_split(a)&.each do |i|
74
- out.inherit { |inh| inh << i }
74
+ out.inherit do |inh|
75
+ inh << HTMLEntities.new.encode(i, :hexadecimal)
76
+ end
75
77
  end
76
78
  classif = node.attr("classification") and
77
79
  requirement_classification(classif, out)
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "2.1.0".freeze
22
+ VERSION = "2.1.1".freeze
23
23
  end
24
24
  end