kramdown-rfc2629 1.6.2 → 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0cbc05053ff35b95300e9fcbb48ee48499434af71e7689c36e7cf5ab2385d57
4
- data.tar.gz: 3d1d2665bee5c8e833b07861eb81bd5b1e7a09ad0a2647af23c55dcff2c10446
3
+ metadata.gz: e0115e72b1d82f546c2681cc3f25a9e473b976bd32f70cf5c922cf31345a24b3
4
+ data.tar.gz: 914787571e83ab08a6a355ca280fe4e85c79d00fd4c25446702edf824b39f968
5
5
  SHA512:
6
- metadata.gz: 0f94ba68e6dfc8ee2026a8bc42182fdabb2016a062b25ec5109334eddda2383515ee1962449815f26a54097f0560f8a7c4aeb7441674ff0c3095e8dfabc8e943
7
- data.tar.gz: d1898de3f1a8f73b5f126bf1d833ce61eff37d65f10acf7219dc0e89e7b94b7b5a37ac95ac5773251abf712256368a02f480de99ecbbbbb4e4c68939c76382bb
6
+ metadata.gz: d07f0c3c4d96dd0dfb9833ec57dcf6b1221aee08d1df3d0819a8263e1f499a152661e8e2d0d6cf0cb40a16083f2ea8abd416849c500a6fad60c37722166ba18a
7
+ data.tar.gz: f7a157dc317405b405a02a39b459e510e5a6cff2488f79abe261501c40cb6d1ed152034a49ddfd90cfb274cc8c8eb5962d043624a6d856354a63b34f8fefb3c6
@@ -169,6 +169,10 @@
169
169
 
170
170
  <back>
171
171
 
172
+ <% displayref.each do |k, v| -%>
173
+ <displayreference target="<%=k%>" to="<%=v%>"/>
174
+ <% end -%>
175
+
172
176
  <% if sh = sechash.delete("normative") -%>
173
177
  <references title='Normative References'>
174
178
 
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.6.2'
3
+ s.version = '1.6.5'
4
4
  s.summary = "Kramdown extension for generating RFCXML (RFC 799x)."
5
5
  s.description = %{An RFCXML (RFC 799x) generating backend for Thomas Leitner's
6
6
  "kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -283,6 +283,8 @@ def xml_from_sections(input)
283
283
  ref_replacements = { }
284
284
  anchor_to_bibref = { }
285
285
 
286
+ displayref = {}
287
+
286
288
  [:ref, :normative, :informative].each do |sn|
287
289
  if refs = ps.has(sn)
288
290
  warn "*** bad section #{sn}: #{refs.inspect}" unless refs.respond_to? :each
@@ -300,6 +302,9 @@ def xml_from_sections(input)
300
302
  if bibref = v.delete("=")
301
303
  anchor_to_bibref[k] = bibref
302
304
  end
305
+ if dr = v.delete("display")
306
+ displayref[k] = dr
307
+ end
303
308
  end
304
309
  end
305
310
  end
@@ -93,6 +93,10 @@ module KramdownRFC
93
93
  def self.handle_ins(aups, ins_k, initials_k, surname_k)
94
94
  if ins = aups[ins_k]
95
95
  parts = ins.split('.').map(&:strip) # split on dots first
96
+ if parts == []
97
+ warn "*** an empty '#{ins_k}:' value is not useful, try leaving it out"
98
+ return
99
+ end
96
100
  # Coalesce H.-P.
97
101
  i = 1; while i < parts.size
98
102
  if parts[i][0] == "-"
@@ -115,6 +119,10 @@ module KramdownRFC
115
119
  def self.handle_name(aups, fn_k, initials_k, surname_k)
116
120
  if name = aups.rest[fn_k]
117
121
  names = name.split(/ *\| */, 2) # boundary for given/last name
122
+ if names == []
123
+ warn "*** an empty '#{fn_k}:' value is not useful, try leaving it out"
124
+ return
125
+ end
118
126
  if names[1]
119
127
  aups.rest[fn_k] = name = names.join(" ") # remove boundary
120
128
  if surname = aups.rest[surname_k]
@@ -125,6 +133,10 @@ module KramdownRFC
125
133
  aups.rest[surname_k] = names[1]
126
134
  end
127
135
  parts = name.split
136
+ if parts == []
137
+ warn "*** a blank '#{fn_k}:' value is not useful, try leaving it out"
138
+ return
139
+ end
128
140
  surname = aups.rest[surname_k] || parts[-1]
129
141
  s = surname.split
130
142
  aups.rest[initials_k] ||= initials_from_parts_and_surname(aups, parts, s)
@@ -722,7 +722,12 @@ COLORS
722
722
  attrstring = html_attributes({'slugifiedName' => sl})
723
723
  end
724
724
  # noabbrev: true -- Workaround for https://trac.ietf.org/trac/xml2rfc/ticket/683
725
- irefs = "<name#{attrstring}>#{inner(el, indent, opts.merge(noabbrev: true))}</name>" #
725
+ nm = inner(el, indent, opts.merge(noabbrev: true))
726
+ if ttl = el.attr['title']
727
+ warn "*** Section has two titles: >>#{ttl}<< and >>#{nm}<<"
728
+ warn "*** Do you maybe have a loose IAL?"
729
+ end
730
+ irefs = "<name#{attrstring}>#{nm}</name>" #
726
731
  else
727
732
  clean, irefs = clean_pcdata(inner_a(el, indent, opts))
728
733
  el.attr['title'] = clean
@@ -914,6 +919,17 @@ COLORS
914
919
  gi = el.attr.delete('gi')
915
920
  res = inner(el, indent, opts)
916
921
  target = el.attr['target']
922
+ if target[0..1] == "{{"
923
+ # XXX ignoring all attributes and content
924
+ s = ::Kramdown::Converter::Rfc2629::process_markdown(target)
925
+ # if res != '' && s[-2..-1] == '/>'
926
+ # if s =~ /\A<([-A-Za-z0-9_.]+) /
927
+ # gi ||= $1
928
+ # end
929
+ # s[-2..-1] = ">#{res}</#{gi}>"
930
+ # end
931
+ return s
932
+ end
917
933
  if target[0] == "#" # handle [](#foo) as xref as in RFC 7328
918
934
  el.attr['target'] = target = target[1..-1]
919
935
  if target.downcase == res.downcase
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-rfc2629
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-24 00:00:00.000000000 Z
11
+ date: 2022-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.3.3
126
+ rubygems_version: 3.3.7
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Kramdown extension for generating RFCXML (RFC 799x).