kramdown-rfc2629 1.7.34 → 1.7.36

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: 578ba11fded96819876c37b58d2218984ea5e555d45b92b6f43eb9e0bf0db92e
4
- data.tar.gz: 60005eb557bee97cf0ce1edfe00a64c976a6b2e8df999f9dc1a30ca6aa346bd9
3
+ metadata.gz: a9ff7213b94221a765a71330807020f096d5359482a00597494a7b7ac947a3ab
4
+ data.tar.gz: c9950dd8e71d8dcd45d128a1ef505c10336ce66fba9a790e4db4db114902e02c
5
5
  SHA512:
6
- metadata.gz: 6d1e37362972e50c000f548921a8e34d6eab1d54c81fabb1a563eee7218806593f8db5dbf74007ff2a2bd221f6249e57c853e83c5c8f9315301e82fd45b0fffb
7
- data.tar.gz: 5ac5dc95f10144fbf805b644df0cef37b7bb3bbb15c1fa9ae75e0b5ec9bd437d8539a5e60d0885f7ead3b611d978aa4c54ac4662c996cf4b7d11c5783cb2e578
6
+ metadata.gz: df87cfdc51a33bdc89a67723a66f475671d29d71ace9796bd2698135ee4b99e3a62072a0412ec9c0773b202790beae1a8d8ad10d7c8c41dd43c0a57812973018
7
+ data.tar.gz: 1c4de95e1f2dffdac9faff39ed32853cf36ae072ee6bdb447c8ce87f74203ca24165e391d1ee5fe92bc49ecc20ae6abf57a44d6cb26917e33096b9156528f7a1
@@ -1,12 +1,11 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.7.34'
3
+ s.version = '1.7.36'
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.}
7
7
  s.add_dependency('kramdown', '~> 2.4.0')
8
8
  s.add_dependency('kramdown-parser-gfm', '~> 1.1')
9
- s.add_dependency('certified', '~> 1.0')
10
9
  s.add_dependency('json_pure', '~> 2.0')
11
10
  s.add_dependency('unicode-name', '~> 1.0')
12
11
  s.add_dependency('unicode-blocks', '~> 1.0')
@@ -180,16 +180,8 @@ def do_the_tls_dance
180
180
  File.open(OpenSSL::X509::DEFAULT_CERT_FILE) do end
181
181
  # This guards against having an unreadable cert file (yes, that appears to happen a lot).
182
182
  rescue
183
- if Dir[File.join(OpenSSL::X509::DEFAULT_CERT_DIR, "*.pem")].empty?
184
- # This guards against having no certs at all, not against missing the right one for IETF.
185
- # Oh well.
186
- warn "** Configuration problem with OpenSSL certificate store."
187
- warn "** You may want to examine #{OpenSSL::X509::DEFAULT_CERT_FILE}"
188
- warn "** and #{OpenSSL::X509::DEFAULT_CERT_DIR}."
189
- warn "** Activating suboptimal workaround."
190
- warn "** Occasionally run `certified-update` to maintain that workaround."
191
- require 'certified'
192
- end
183
+ warn "*** Configuration problem with OS certificate store."
184
+ exit 71 # EX_OSERR
193
185
  end
194
186
  end
195
187
 
@@ -200,8 +192,12 @@ NMDTAGS = ["{:/nomarkdown}\n\n", "\n\n{::nomarkdown}\n"]
200
192
 
201
193
  NORMINFORM = { "!" => :normative, "?" => :informative }
202
194
 
203
- def yaml_load(input, *args)
204
- begin
195
+
196
+ # Handle several transitions of YAML API:
197
+ # * very early Ruby (no safe_load, before Ruby 2.1)
198
+ # * Ruby before 3.1 (safe_load, positional parameters)
199
+ # * Ruby 2.6 up (safe_load, keyword parameters)
200
+ def yaml_load_compat(input, *args)
205
201
  if YAML.respond_to?(:safe_load)
206
202
  begin
207
203
  YAML.safe_load(input, *args)
@@ -211,10 +207,25 @@ def yaml_load(input, *args)
211
207
  else
212
208
  YAML.load(input)
213
209
  end
214
- rescue Psych::SyntaxError => e
215
- warn "*** YAML syntax error: #{e}"
216
- exit 65 # EX_DATAERR
217
- end
210
+ end
211
+
212
+ def yaml_diagnose(input, *args)
213
+ l = input.lines.to_a
214
+ (l.size-1).downto(0) do |nl|
215
+ yaml_load_compat(l[0...nl].join, *args) rescue next
216
+ warn "** YAML appears to be parsable up to line #{nl}"
217
+ return
218
+ end
219
+ end
220
+
221
+ def yaml_load(input, *args)
222
+ begin
223
+ yaml_load_compat(input, *args)
224
+ rescue Psych::SyntaxError => e
225
+ warn "*** YAML syntax error: #{e}"
226
+ yaml_diagnose(input, *args) rescue nil
227
+ exit 65 # EX_DATAERR
228
+ end
218
229
  end
219
230
 
220
231
  def process_kramdown_options(coding_override = nil,
@@ -311,13 +322,13 @@ def xml_from_sections(input)
311
322
  # the first section is a YAML with front matter parameters (don't put a label here)
312
323
  # We put back the "---" plus gratuitous blank lines to hack the line number in errors
313
324
  yaml_in = input[/---\s*/] << sections.shift[2]
325
+ ps = KramdownRFC::ParameterSet.new(yaml_load(yaml_in, [Date], [], true))
314
326
  begin
315
327
  require 'kramdown-rfc/yamlcheck'
316
328
  KramdownRFC::YAMLcheck.check_dup_keys(yaml_in)
317
329
  rescue => e
318
330
  warn "** Cannot check for duplicate keys in YAML header (#{e})"
319
331
  end
320
- ps = KramdownRFC::ParameterSet.new(yaml_load(yaml_in, [Date], [], true))
321
332
 
322
333
  if v = ps[:v]
323
334
  warn "*** unsupported RFCXML version #{v}" if v != 3
@@ -745,7 +745,7 @@ COLORS
745
745
  "<![CDATA[#{result}#{result =~ /\n\Z/ ? '' : "\n"}]]>")
746
746
  if result1 # nest TXT in artset with SVG
747
747
  retsvg = mk_artwork(artwork_attr, "svg",
748
- result1.sub(/.*?<svg/m, "<svg"))
748
+ result1.sub(/.*?<svg/m, "<svg")) # , t == "mermaid")
749
749
  retart = "<artset>#{retsvg}#{retart}</artset>"
750
750
  end
751
751
  "#{' '*indent}<figure#{el_html_attributes(el)}>#{retart}</figure>\n"
@@ -844,8 +844,14 @@ COLORS
844
844
  result
845
845
  end
846
846
 
847
- def mk_artwork(artwork_attr, typ, content)
848
- "<artwork #{html_attributes(artwork_attr.merge("type" => typ))}>#{content}</artwork>"
847
+ def mk_artwork(artwork_attr, typ, content, use_data = false)
848
+ if use_data
849
+ warn "** using data URI for artwork type #{typ}"
850
+ data = %{data:application/octet-stream;base64,#{[content].pack('m0')}}
851
+ "<artwork #{html_attributes(artwork_attr.merge("type" => typ, "src" => data))}></artwork>"
852
+ else
853
+ "<artwork #{html_attributes(artwork_attr.merge("type" => typ))}>#{content}</artwork>"
854
+ end
849
855
  end
850
856
 
851
857
  def convert_blockquote(el, indent, opts)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-rfc2629
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.34
4
+ version: 1.7.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
@@ -37,20 +37,6 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.1'
40
- - !ruby/object:Gem::Dependency
41
- name: certified
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.0'
47
- type: :runtime
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.0'
54
40
  - !ruby/object:Gem::Dependency
55
41
  name: json_pure
56
42
  requirement: !ruby/object:Gem::Requirement
@@ -238,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
224
  - !ruby/object:Gem::Version
239
225
  version: '0'
240
226
  requirements: []
241
- rubygems_version: 4.0.2
227
+ rubygems_version: 4.0.8
242
228
  specification_version: 4
243
229
  summary: Kramdown extension for generating RFCXML (RFC 799x).
244
230
  test_files: []