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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cc58286193e50f5ca184b5d5439465515299913c90f81ee497260d75603a2a8
|
4
|
+
data.tar.gz: ec80b7fb69439a96da2b7ece19695cc613545e118686bb2e915e66484091b020
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
38
|
+
# do not accidentally XML tags when inserting text with < 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
|