metanorma-standoc 1.10.2 → 1.10.3
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/asciidoctor/standoc/cleanup.rb +60 -0
- data/lib/asciidoctor/standoc/converter.rb +2 -0
- data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +22 -21
- data/lib/asciidoctor/standoc/isodoc.rng +6 -0
- data/lib/asciidoctor/standoc/macros.rb +18 -0
- data/lib/asciidoctor/standoc/ref.rb +60 -56
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor/blocks_spec.rb +2 -2
- data/spec/asciidoctor/cleanup_sections_spec.rb +899 -864
- data/spec/asciidoctor/cleanup_spec.rb +36 -2
- data/spec/asciidoctor/macros_plantuml_spec.rb +165 -104
- data/spec/asciidoctor/macros_spec.rb +99 -0
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +34 -34
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a43a3db1e4ef2ae43a1b2c7ecd980384cac2ee645668e414c73fd8e53dee3859
|
4
|
+
data.tar.gz: 6f026c1bd2e1d0c5f2f327cdc345af6635ff1c1454479fd42709b9d18fda5e60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b20738029106d832a852db8eabf340058cdcbf75d8ce16def000478733c3633ad1144ac1aa2f736a637423c19f90491429fbec591987bc2f4af58bb3c8df087
|
7
|
+
data.tar.gz: 69f3e40acdca71435cda97dbcd33e862ffbacbb4eeaff97e543b971ec2744c72227115013ef2ac3ee88552c64bf413a36c060adf3af58e6ebb86c6b85997b070
|
@@ -62,6 +62,7 @@ module Asciidoctor
|
|
62
62
|
bibdata_cleanup(xmldoc)
|
63
63
|
svgmap_cleanup(xmldoc)
|
64
64
|
boilerplate_cleanup(xmldoc)
|
65
|
+
toc_cleanup(xmldoc)
|
65
66
|
smartquotes_cleanup(xmldoc)
|
66
67
|
variant_cleanup(xmldoc)
|
67
68
|
para_cleanup(xmldoc)
|
@@ -84,6 +85,29 @@ module Asciidoctor
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def smartquotes_cleanup1(xmldoc)
|
88
|
+
uninterrupt_quotes_around_xml(xmldoc)
|
89
|
+
dumb2smart_quotes(xmldoc)
|
90
|
+
end
|
91
|
+
|
92
|
+
# "abc<tag/>", def => "abc",<tag/> def
|
93
|
+
def uninterrupt_quotes_around_xml(xmldoc)
|
94
|
+
xmldoc.xpath("//*[following::text()[1]"\
|
95
|
+
"[starts-with(., '\"') or starts-with(., \"'\")]]")
|
96
|
+
.each do |x|
|
97
|
+
uninterrupt_quotes_around_xml1(x)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def uninterrupt_quotes_around_xml1(elem)
|
102
|
+
prev = elem.at(".//preceding::text()[1]") or return
|
103
|
+
/\S$/.match?(prev.text) or return
|
104
|
+
foll = elem.at(".//following::text()[1]")
|
105
|
+
m = /^(["'][[:punct:]]*)(\s|$)/.match(foll&.text) or return
|
106
|
+
foll.content = foll.text.sub(/^(["'][[:punct:]]*)/, "")
|
107
|
+
prev.content = "#{prev.text}#{m[1]}"
|
108
|
+
end
|
109
|
+
|
110
|
+
def dumb2smart_quotes(xmldoc)
|
87
111
|
(xmldoc.xpath("//*[child::text()]") - xmldoc.xpath(IGNORE_DUMBQUOTES))
|
88
112
|
.each do |x|
|
89
113
|
x.children.each do |n|
|
@@ -166,6 +190,42 @@ module Asciidoctor
|
|
166
190
|
end
|
167
191
|
end
|
168
192
|
end
|
193
|
+
|
194
|
+
def toc_cleanup(xmldoc)
|
195
|
+
xmldoc.xpath("//p[toc]").each do |x|
|
196
|
+
x.xpath("./toc").reverse.each do |t|
|
197
|
+
x.next = t
|
198
|
+
end
|
199
|
+
x.remove if x.text.strip.empty?
|
200
|
+
end
|
201
|
+
xmldoc.xpath("//toc").each { |t| toc_cleanup1(t, xmldoc) }
|
202
|
+
end
|
203
|
+
|
204
|
+
def toc_index(toc, xmldoc)
|
205
|
+
depths = toc.xpath("./toc-xpath").each_with_object({}) do |x, m|
|
206
|
+
m[x.text] = x["depth"]
|
207
|
+
end
|
208
|
+
depths.keys.each_with_object([]) do |key, arr|
|
209
|
+
xmldoc.xpath(key).each do |x|
|
210
|
+
arr << { text: x.children.to_xml, depth: depths[key].to_i,
|
211
|
+
target: x.xpath("(./ancestor-or-self::*/@id)[last()]")[0].text,
|
212
|
+
line: x.line }
|
213
|
+
end
|
214
|
+
end.sort_by { |a| a[:line] }
|
215
|
+
end
|
216
|
+
|
217
|
+
def toc_cleanup1(toc, xmldoc)
|
218
|
+
depth = 1
|
219
|
+
ret = ""
|
220
|
+
toc_index(toc, xmldoc).each do |x|
|
221
|
+
if depth > x[:depth] then ret += "</ul></li>" * (depth - x[:depth])
|
222
|
+
elsif depth < x[:depth] then ret += "<li><ul>" * (x[:depth] - depth)
|
223
|
+
end
|
224
|
+
ret += "<li><xref target='#{x[:target]}'>#{x[:text]}</xref></li>"
|
225
|
+
depth = x[:depth]
|
226
|
+
end
|
227
|
+
toc.children = "<ul>#{ret}</ul>"
|
228
|
+
end
|
169
229
|
end
|
170
230
|
end
|
171
231
|
end
|
@@ -47,6 +47,8 @@ module Asciidoctor
|
|
47
47
|
inline_macro Asciidoctor::Standoc::FormTextareaMacro
|
48
48
|
inline_macro Asciidoctor::Standoc::FormSelectMacro
|
49
49
|
inline_macro Asciidoctor::Standoc::FormOptionMacro
|
50
|
+
inline_macro Asciidoctor::Standoc::ToCInlineMacro
|
51
|
+
block_macro Metanorma::Plugin::Lutaml::LutamlDiagramBlockMacro
|
50
52
|
block Asciidoctor::Standoc::ToDoAdmonitionBlock
|
51
53
|
treeprocessor Asciidoctor::Standoc::ToDoInlineAdmonitionBlock
|
52
54
|
block Asciidoctor::Standoc::PlantUMLBlockMacro
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "erb"
|
4
|
+
require "asciidoctor/standoc/datamodel/plantuml_renderer"
|
5
5
|
|
6
6
|
module Asciidoctor
|
7
7
|
module Standoc
|
8
8
|
module Datamodel
|
9
9
|
class DiagramPreprocessor < Asciidoctor::Extensions::Preprocessor
|
10
|
-
BLOCK_START_REGEXP = /\{(.+?)\.\*,(.+),(.+)\}
|
11
|
-
BLOCK_END_REGEXP = /\A\{[A-Z]+\}\z
|
12
|
-
MARCO_REGEXP = /\[datamodel_diagram,([^,]+),?(.+)?\]
|
13
|
-
TEMPLATES_PATH = File.expand_path(
|
10
|
+
BLOCK_START_REGEXP = /\{(.+?)\.\*,(.+),(.+)\}/.freeze
|
11
|
+
BLOCK_END_REGEXP = /\A\{[A-Z]+\}\z/.freeze
|
12
|
+
MARCO_REGEXP = /\[datamodel_diagram,([^,]+),?(.+)?\]/.freeze
|
13
|
+
TEMPLATES_PATH = File.expand_path("../views/datamodel", __dir__).freeze
|
14
14
|
# search document for block `datamodel_diagram`
|
15
15
|
# read include derectives that goes after that in block and transform
|
16
16
|
# into plantuml block
|
@@ -33,7 +33,7 @@ module Asciidoctor
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def parse_datamodel_marco(yaml_path, include_path, document)
|
36
|
-
include_path ||= File.join(File.dirname(yaml_path),
|
36
|
+
include_path ||= File.join(File.dirname(yaml_path), "..", "models")
|
37
37
|
include_path = yaml_relative_path(include_path, document)
|
38
38
|
yaml_relative_to_doc_path = yaml_relative_path(yaml_path, document)
|
39
39
|
view_hash = YAML.safe_load(File.read(yaml_relative_to_doc_path))
|
@@ -43,7 +43,7 @@ module Asciidoctor
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def yaml_relative_path(file_path, document)
|
46
|
-
docfile = document.attributes[
|
46
|
+
docfile = document.attributes["docfile"] || "."
|
47
47
|
docfile_directory = File.dirname(docfile)
|
48
48
|
document.path_resolver.system_path(file_path, docfile_directory)
|
49
49
|
end
|
@@ -51,11 +51,11 @@ module Asciidoctor
|
|
51
51
|
def import_format(include_path, import_name, values)
|
52
52
|
include_content = File.read(File.join(
|
53
53
|
include_path,
|
54
|
-
"#{import_name}.yml"
|
55
|
-
|
54
|
+
"#{import_name}.yml",
|
55
|
+
))
|
56
56
|
content = YAML.safe_load(include_content)
|
57
57
|
if values
|
58
|
-
content[
|
58
|
+
content["skipSection"] = values["skipSection"]
|
59
59
|
end
|
60
60
|
content
|
61
61
|
end
|
@@ -63,36 +63,37 @@ module Asciidoctor
|
|
63
63
|
def format_import_directives(imports, include_path)
|
64
64
|
imports
|
65
65
|
.each_with_object({}) do |(import_name, values), res|
|
66
|
-
full_model_name = import_name.split(
|
66
|
+
full_model_name = import_name.split("/").join
|
67
67
|
content = import_format(include_path, import_name, values)
|
68
|
-
res[content[
|
68
|
+
res[content["name"] || full_model_name] = content
|
69
69
|
end.compact
|
70
70
|
end
|
71
71
|
|
72
72
|
def prepare_view_hash(view_hash, all_imports)
|
73
73
|
view_hash.merge!(
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
.merge!(
|
74
|
+
"classes" => model_type(all_imports, "class"),
|
75
|
+
"enums" => model_type(all_imports, "enum"),
|
76
|
+
"relations" => view_hash["relations"] || [],
|
77
|
+
"fidelity" => (view_hash["fidelity"] || {})
|
78
|
+
.merge!("classes" => model_type(all_imports,
|
79
|
+
"class")),
|
79
80
|
)
|
80
81
|
end
|
81
82
|
|
82
83
|
def model_type(imports, type)
|
83
84
|
imports
|
84
85
|
.select do |_name, elem|
|
85
|
-
elem[
|
86
|
+
elem["modelType"] == type
|
86
87
|
end
|
87
88
|
end
|
88
89
|
|
89
90
|
def plantuml_representations(view_hash, view_path, include_path)
|
90
91
|
yaml_directory = File.dirname(view_path)
|
91
|
-
all_imports = format_import_directives(view_hash[
|
92
|
+
all_imports = format_import_directives(view_hash["imports"],
|
92
93
|
include_path)
|
93
94
|
prepare_view_hash(view_hash, all_imports)
|
94
95
|
Asciidoctor::Datamodel::PlantumlRenderer
|
95
|
-
.new(view_hash, File.join(yaml_directory,
|
96
|
+
.new(view_hash, File.join(yaml_directory, ".."))
|
96
97
|
.render
|
97
98
|
.split("\n")
|
98
99
|
end
|
@@ -1254,6 +1254,12 @@
|
|
1254
1254
|
<optional>
|
1255
1255
|
<attribute name="type"/>
|
1256
1256
|
</optional>
|
1257
|
+
<optional>
|
1258
|
+
<attribute name="identifier"/>
|
1259
|
+
</optional>
|
1260
|
+
<optional>
|
1261
|
+
<attribute name="prefix"/>
|
1262
|
+
</optional>
|
1257
1263
|
<text/>
|
1258
1264
|
</define>
|
1259
1265
|
<define name="ics">
|
@@ -2,6 +2,7 @@ require "asciidoctor/extensions"
|
|
2
2
|
require "fileutils"
|
3
3
|
require "uuidtools"
|
4
4
|
require "yaml"
|
5
|
+
require "csv"
|
5
6
|
require_relative "./macros_plantuml"
|
6
7
|
require_relative "./macros_terms"
|
7
8
|
require_relative "./macros_form"
|
@@ -211,5 +212,22 @@ module Asciidoctor
|
|
211
212
|
%{<del>#{out}</del>}
|
212
213
|
end
|
213
214
|
end
|
215
|
+
|
216
|
+
class ToCInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
217
|
+
use_dsl
|
218
|
+
named :toc
|
219
|
+
parse_content_as :text
|
220
|
+
using_format :short
|
221
|
+
|
222
|
+
def process(parent, _target, attrs)
|
223
|
+
out = Asciidoctor::Inline.new(parent, :quoted, attrs["text"]).convert
|
224
|
+
content = CSV.parse_line(out).map do |x|
|
225
|
+
x.sub!(/^(["'])(.+)\1/, "\\2")
|
226
|
+
m = /^(.*?)(:\d+)?$/.match(x)
|
227
|
+
%{<toc-xpath depth='#{m[2]&.sub(/:/, '') || 1}'>#{m[1]}</toc-xpath>}
|
228
|
+
end.join
|
229
|
+
"<toc>#{content}</toc>"
|
230
|
+
end
|
231
|
+
end
|
214
232
|
end
|
215
233
|
end
|
@@ -4,7 +4,7 @@ module Asciidoctor
|
|
4
4
|
module Standoc
|
5
5
|
module Refs
|
6
6
|
def iso_publisher(bib, code)
|
7
|
-
code.sub(/ .*$/, "").split(
|
7
|
+
code.sub(/ .*$/, "").split("/").each do |abbrev|
|
8
8
|
bib.contributor do |c|
|
9
9
|
c.role **{ type: "publisher" }
|
10
10
|
c.organization do |org|
|
@@ -18,75 +18,78 @@ module Asciidoctor
|
|
18
18
|
{ format: "text/plain" }
|
19
19
|
end
|
20
20
|
|
21
|
-
def ref_attributes(
|
22
|
-
{ id:
|
21
|
+
def ref_attributes(match)
|
22
|
+
{ id: match[:anchor], type: "standard" }
|
23
23
|
end
|
24
24
|
|
25
|
-
def isorefrender1(bib,
|
26
|
-
bib.title(**plaintxt) { |i| i << ref_normalise(
|
27
|
-
docid(bib,
|
28
|
-
docid(bib, id_and_year(
|
29
|
-
docnumber(bib,
|
25
|
+
def isorefrender1(bib, match, yr, allp = "")
|
26
|
+
bib.title(**plaintxt) { |i| i << ref_normalise(match[:text]) }
|
27
|
+
docid(bib, match[:usrlbl]) if match[:usrlbl]
|
28
|
+
docid(bib, id_and_year(match[:code], yr) + allp)
|
29
|
+
docnumber(bib, match[:code])
|
30
30
|
end
|
31
31
|
|
32
|
-
def isorefmatches(xml,
|
33
|
-
yr = norm_year(
|
34
|
-
ref = fetch_ref xml,
|
35
|
-
|
36
|
-
|
32
|
+
def isorefmatches(xml, match)
|
33
|
+
yr = norm_year(match[:year])
|
34
|
+
ref = fetch_ref xml, match[:code], yr,
|
35
|
+
title: match[:text], usrlbl: match[:usrlbl],
|
36
|
+
lang: (@lang || :all)
|
37
|
+
return use_my_anchor(ref, match[:anchor]) if ref
|
37
38
|
|
38
|
-
xml.bibitem **attr_code(ref_attributes(
|
39
|
-
isorefrender1(t,
|
39
|
+
xml.bibitem **attr_code(ref_attributes(match)) do |t|
|
40
|
+
isorefrender1(t, match, yr)
|
40
41
|
yr and t.date **{ type: "published" } do |d|
|
41
42
|
set_date_range(d, yr)
|
42
43
|
end
|
43
|
-
iso_publisher(t,
|
44
|
+
iso_publisher(t, match[:code])
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
|
-
def isorefmatches2(xml,
|
48
|
-
ref = fetch_ref xml,
|
49
|
-
|
50
|
-
|
48
|
+
def isorefmatches2(xml, match)
|
49
|
+
ref = fetch_ref xml, match[:code], nil,
|
50
|
+
no_year: true, note: match[:fn],
|
51
|
+
title: match[:text], usrlbl: match[:usrlbl],
|
52
|
+
lang: (@lang || :all)
|
53
|
+
return use_my_anchor(ref, match[:anchor]) if ref
|
51
54
|
|
52
|
-
isorefmatches2_1(xml,
|
55
|
+
isorefmatches2_1(xml, match)
|
53
56
|
end
|
54
57
|
|
55
|
-
def isorefmatches2_1(xml,
|
56
|
-
xml.bibitem **attr_code(ref_attributes(
|
57
|
-
isorefrender1(t,
|
58
|
+
def isorefmatches2_1(xml, match)
|
59
|
+
xml.bibitem **attr_code(ref_attributes(match)) do |t|
|
60
|
+
isorefrender1(t, match, "--")
|
58
61
|
t.date **{ type: "published" } do |d|
|
59
62
|
d.on "--"
|
60
63
|
end
|
61
|
-
iso_publisher(t,
|
62
|
-
unless
|
64
|
+
iso_publisher(t, match[:code])
|
65
|
+
unless match[:fn].nil?
|
63
66
|
t.note(**plaintxt.merge(type: "Unpublished-Status")) do |p|
|
64
|
-
|
67
|
+
p << (match[:fn]).to_s
|
65
68
|
end
|
66
69
|
end
|
67
70
|
end
|
68
71
|
end
|
69
72
|
|
70
|
-
def isorefmatches3(xml,
|
71
|
-
yr = norm_year(
|
73
|
+
def isorefmatches3(xml, match)
|
74
|
+
yr = norm_year(match[:year])
|
72
75
|
hasyr = !yr.nil? && yr != "--"
|
73
|
-
ref = fetch_ref(xml,
|
74
|
-
all_parts: true,
|
75
|
-
|
76
|
+
ref = fetch_ref(xml, match[:code], hasyr ? yr : nil,
|
77
|
+
all_parts: true, no_year: yr == "--",
|
78
|
+
text: match[:text], usrlbl: match[:usrlbl],
|
76
79
|
lang: (@lang || :all))
|
77
|
-
return use_my_anchor(ref,
|
80
|
+
return use_my_anchor(ref, match[:anchor]) if ref
|
78
81
|
|
79
|
-
isorefmatches3_1(xml,
|
82
|
+
isorefmatches3_1(xml, match, yr, hasyr, ref)
|
80
83
|
end
|
81
84
|
|
82
|
-
def isorefmatches3_1(xml,
|
83
|
-
xml.bibitem(**attr_code(ref_attributes(
|
84
|
-
isorefrender1(t,
|
85
|
-
conditional_date(t,
|
86
|
-
iso_publisher(t,
|
87
|
-
if
|
85
|
+
def isorefmatches3_1(xml, match, yr, _hasyr, _ref)
|
86
|
+
xml.bibitem(**attr_code(ref_attributes(match))) do |t|
|
87
|
+
isorefrender1(t, match, yr, " (all parts)")
|
88
|
+
conditional_date(t, match, yr == "--")
|
89
|
+
iso_publisher(t, match[:code])
|
90
|
+
if match.names.include?("fn") && match[:fn]
|
88
91
|
t.note(**plaintxt.merge(type: "Unpublished-Status")) do |p|
|
89
|
-
p << (
|
92
|
+
p << (match[:fn]).to_s
|
90
93
|
end
|
91
94
|
end
|
92
95
|
t.extent **{ type: "part" } do |e|
|
@@ -95,23 +98,23 @@ module Asciidoctor
|
|
95
98
|
end
|
96
99
|
end
|
97
100
|
|
98
|
-
def refitem_render1(
|
101
|
+
def refitem_render1(match, code, bib)
|
99
102
|
if code[:type] == "path"
|
100
103
|
bib.uri code[:key].sub(/\.[a-zA-Z0-9]+$/, ""), **{ type: "URI" }
|
101
104
|
bib.uri code[:key].sub(/\.[a-zA-Z0-9]+$/, ""), **{ type: "citation" }
|
102
105
|
end
|
103
|
-
docid(bib,
|
106
|
+
docid(bib, match[:usrlbl]) if match[:usrlbl]
|
104
107
|
docid(bib, /^\d+$/.match?(code[:id]) ? "[#{code[:id]}]" : code[:id])
|
105
108
|
code[:type] == "repo" and
|
106
109
|
bib.docidentifier code[:key], **{ type: "repository" }
|
107
110
|
end
|
108
111
|
|
109
|
-
def refitem_render(xml,
|
110
|
-
xml.bibitem **attr_code(id:
|
112
|
+
def refitem_render(xml, match, code)
|
113
|
+
xml.bibitem **attr_code(id: match[:anchor]) do |t|
|
111
114
|
t.formattedref **{ format: "application/x-isodoc+xml" } do |i|
|
112
|
-
i << ref_normalise_no_format(
|
115
|
+
i << ref_normalise_no_format(match[:text])
|
113
116
|
end
|
114
|
-
refitem_render1(
|
117
|
+
refitem_render1(match, code, t)
|
115
118
|
docnumber(t, code[:id]) unless /^\d+$|^\(.+\)$/.match?(code[:id])
|
116
119
|
end
|
117
120
|
end
|
@@ -128,7 +131,7 @@ module Asciidoctor
|
|
128
131
|
|
129
132
|
def analyse_ref_repo_path(ret)
|
130
133
|
return ret unless m =
|
131
|
-
|
134
|
+
/^(?<type>repo|path):\((?<key>[^,]+),?(?<id>.*)\)$/.match(ret[:id])
|
132
135
|
|
133
136
|
id = m[:id].empty? ? m[:key].sub(%r{^[^/]+/}, "") : m[:id]
|
134
137
|
ret.merge(id: id, type: m[:type], key: m[:key], nofetch: true)
|
@@ -156,16 +159,17 @@ module Asciidoctor
|
|
156
159
|
nil
|
157
160
|
end
|
158
161
|
|
159
|
-
def refitem1(xml, _item,
|
160
|
-
code = analyse_ref_code(
|
162
|
+
def refitem1(xml, _item, match)
|
163
|
+
code = analyse_ref_code(match[:code])
|
161
164
|
unless code[:id] && code[:numeric] || code[:nofetch]
|
162
165
|
ref = fetch_ref(xml, code[:id],
|
163
|
-
|
164
|
-
title:
|
165
|
-
usrlbl:
|
166
|
-
|
166
|
+
match.names.include?("year") ? match[:year] : nil,
|
167
|
+
title: match[:text],
|
168
|
+
usrlbl: match[:usrlbl], lang: (@lang || :all)) and
|
169
|
+
return use_my_anchor(ref, match[:anchor])
|
167
170
|
end
|
168
|
-
|
171
|
+
|
172
|
+
refitem_render(xml, match, code)
|
169
173
|
end
|
170
174
|
|
171
175
|
def ref_normalise(ref)
|
@@ -186,7 +190,7 @@ module Asciidoctor
|
|
186
190
|
\[(?<usrlbl>\([^)]+\))?(?<code>(ISO|IEC)[^0-9]*\s[0-9-]+):
|
187
191
|
(--|&\#821[12];)\]</ref>,?\s*
|
188
192
|
(<fn[^>]*>\s*<p>(?<fn>[^\]]+)</p>\s*</fn>)?,?\s?(?<text>.*)$}xm
|
189
|
-
|
193
|
+
.freeze
|
190
194
|
|
191
195
|
ISO_REF_ALL_PARTS =
|
192
196
|
%r{^<ref\sid="(?<anchor>[^"]+)">
|