metanorma-standoc 3.0.12 → 3.0.13
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 +4 -4
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +13 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1a328bc633de225d53ddab6fe77c453650010590a0c8d28af8e5c75fb7a7e26
|
4
|
+
data.tar.gz: 07a4781f96a94bffd9bf4020ae706ad3b7ae7e90e9b95d7c499f9116034b43f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14547f8a66ca29c6c388b71ee238055678633323ffeb9d98d7d397b1682910c9b46ef419aac89021cb033215f243df32272cb3a281f707219df6835687c8ce79
|
7
|
+
data.tar.gz: 9651d5e3c45634ead0fb4363e3001dcd9519a16d950fe331db370901258bbadb6296148f9f8a194621ae833555a8a723f7254ad1fc4d5c59b1d4d312b98f9814
|
@@ -65,6 +65,7 @@ module Metanorma
|
|
65
65
|
|
66
66
|
def boilerplate_cleanup(xmldoc)
|
67
67
|
isodoc = boilerplate_isodoc(xmldoc) or return
|
68
|
+
boilerplate_isodoc_values(isodoc)
|
68
69
|
termdef_boilerplate_cleanup(xmldoc)
|
69
70
|
termdef_boilerplate_insert(xmldoc, isodoc)
|
70
71
|
unwrap_boilerplate_clauses(xmldoc, self.class::TERM_CLAUSE)
|
@@ -75,6 +76,18 @@ module Metanorma
|
|
75
76
|
initial_boilerplate(xmldoc, isodoc)
|
76
77
|
end
|
77
78
|
|
79
|
+
# escape < > & to &gt; etc,
|
80
|
+
# for passthrough insertion into boilerplate
|
81
|
+
def boilerplate_isodoc_values(isodoc)
|
82
|
+
isodoc.meta.get.each do |k, v|
|
83
|
+
if v.is_a?(String)
|
84
|
+
isodoc.meta.set(k, v.gsub("&", "&&&&&&&")
|
85
|
+
.gsub("<", "&lt;").gsub(">", "&gt;")
|
86
|
+
.gsub("&&&&&&&", "&amp;"))
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
78
91
|
def initial_boilerplate(xml, isodoc)
|
79
92
|
xml.at("//boilerplate") and return
|
80
93
|
preface = xml.at("//preface | //sections | //annex | //references") or
|