metanorma-standoc 3.0.11 → 3.0.12

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: 14dd3592a7b0cac4d375b01632ea94aee5912282ef0507d4303de2b864dd34f4
4
- data.tar.gz: 74e246856bdc1b864967479d91432f8b4a264a3e85bf887da7233560e9218441
3
+ metadata.gz: 4cc58286193e50f5ca184b5d5439465515299913c90f81ee497260d75603a2a8
4
+ data.tar.gz: ec80b7fb69439a96da2b7ece19695cc613545e118686bb2e915e66484091b020
5
5
  SHA512:
6
- metadata.gz: a27bb5c03d733d0506afef9938d718b57dd40759a53ee20b919abb63d088d732981f31f0674c58f4c3cbf573e59896aa3e389554420449794bd4ea9ba99c3381
7
- data.tar.gz: e5f67c683462e63239c12e39abdf7a5c7dfd6f33b9ad146535ba57150fc69a50b9a9af6864cb1f8ec8876ff354d77bc6b927418fc2b11dd8cbc3859c48a3dc32
6
+ metadata.gz: d28d1413c425808f0fc2f5e41f7ece023b573c6ca3b776a6199f5b04e1fbe31ad3d07d84560c1d00a8ba599f2b95a585f535f51a696828b22d0204bcc87473ff
7
+ data.tar.gz: 790a9adb18645e2c52206235753cdd029fb473b28ede08b9deb39cd64f1c31d710744b3508d50bbaf1b24c63679a58af0217f6e9168e94426660043a56d9c94c
@@ -4,6 +4,7 @@ module Metanorma
4
4
  def textcleanup(result)
5
5
  text = result.flatten.map(&:rstrip) * "\n"
6
6
  text = text.gsub(/(?<!\s)\s+<fn /, "<fn ")
7
+ #@semantic_headless and return text
7
8
  %w(passthrough passthrough-inline).each do |v|
8
9
  text.gsub!(%r{<#{v}\s+formats="metanorma">([^<]*)
9
10
  </#{v}>}mx) { @c.decode($1) }
@@ -34,7 +35,8 @@ module Metanorma
34
35
  out = Metanorma::Utils.line_sanitise(lines)
35
36
  e[:last] or out.pop
36
37
  /\s$/.match?(e[:text][-1]) or out[-1].rstrip!
37
- e[:elem].replace(out.join)
38
+ # do not accidentally XML tags when inserting text with &lt; back in to doc
39
+ e[:elem].replace(@c.encode(out.join, :hexadecimal, :basic))
38
40
  end
39
41
  end
40
42
 
@@ -73,6 +75,7 @@ module Metanorma
73
75
  end
74
76
 
75
77
  def smartquotes_cleanup1(xmldoc)
78
+ # prevent normalising boilerplate text twice
76
79
  uninterrupt_quotes_around_xml(xmldoc)
77
80
  dumb2smart_quotes(xmldoc)
78
81
  end
@@ -98,7 +101,7 @@ module Metanorma
98
101
 
99
102
  IGNORE_QUOTES_ELEMENTS =
100
103
  %w(pre tt sourcecode stem asciimath figure bibdata passthrough
101
- identifier metanorma-extension).freeze
104
+ identifier metanorma-extension boilerplate).freeze
102
105
 
103
106
  PRESERVE_LINEBREAK_ELEMENTS =
104
107
  %w(pre sourcecode passthrough metanorma-extension stem).freeze
@@ -41,6 +41,7 @@ module Metanorma
41
41
  @embed_id = node.attr("embed_id")
42
42
  @document_scheme = document_scheme(node)
43
43
  @source_linenums = node.attr("source-linenums-option") == "true"
44
+ @semantic_headless = node.attr("semantic-metadata-headless") == "true"
44
45
  @default_doctype = "standard"
45
46
  end
46
47
 
@@ -143,7 +143,7 @@ module Metanorma
143
143
  def process(parent, target, attrs)
144
144
  format = target || "metanorma"
145
145
  out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
146
- <<~XML
146
+ <<~XML.strip
147
147
  <passthrough-inline formats="#{format}">#{xml_process(out)}</passthrough-inline>
148
148
  XML
149
149
  end
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "3.0.11".freeze
22
+ VERSION = "3.0.12".freeze
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.11
4
+ version: 3.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.