kramdown-rfc2629 1.3.33 → 1.3.34

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: 7b532912e56847cec71ed5c419ea08af4d19d3f6c7a4d91edffbfaa3005dd37f
4
- data.tar.gz: 6dbf519c9eadbddb50a07f6b1cef88cdcc9d877a5f66614ececf6bf5bc2d3353
3
+ metadata.gz: aea9fb4169327aa3629088261ef7ca4f99b6cdc205326d782a8c43d97818f76b
4
+ data.tar.gz: 1319c3c4e0435633b9dac413c5ed13384a10b245708b8abf55c8c943178ba9e1
5
5
  SHA512:
6
- metadata.gz: 0f7f9faf79c570a7bcca633aef94a6f27d997d861eca1ecad0855795eef44728d925cc1d1b7751454b6c122168d12ef4f341b4ed350d8aeb9247b53e13d523ba
7
- data.tar.gz: 2dcdb7cf588bd99e8e983b71eefbbb0a2aec8785f466abe8e83f6b7ea40061aecea69abe6466d94d2dc69c019dd798a0569e5ed66b65efc42bf76d448ef45778
6
+ metadata.gz: 79cedc2bf3905da08feafd6a856d67d4f4928cc53d21ed2035b05607e2ce55bf8ec455cb7a94f67afc4296c813b05668d425d5c280a1f0e61b435c611dd66ad8
7
+ data.tar.gz: e9026c235426738610a9d3d5a4a2a3d803a5afde25714cab72e4012e882cc285e82755d41d3dfe2d89a8456a044c4c7b1fb14e6f53992db93b3b8d1ac1f2ba1d
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.3.33'
3
+ s.version = '1.3.34'
4
4
  s.summary = "Kramdown extension for generating RFC 7749 XML."
5
5
  s.description = %{An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
6
6
  "kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -373,9 +373,12 @@ COLORS
373
373
  [result, result1] # text, svg
374
374
  end
375
375
 
376
+ ARTWORK_TYPES = %w(ascii-art binary-art call-flow hex-dump svg)
377
+
376
378
  def convert_codeblock(el, indent, opts)
377
379
  # el.attr['anchor'] ||= saner_generate_id(el.value) -- no longer in 1.0.6
378
380
  result = el.value
381
+ gi = el.attr.delete('gi')
379
382
  blockclass = el.attr.delete('class')
380
383
  if blockclass == 'language-tbreak'
381
384
  result = result.lines.map {|line| [line.chomp, 0]}
@@ -402,7 +405,7 @@ COLORS
402
405
  if md = cl.match(/\Alanguage-(.*)/)
403
406
  t = artwork_attr["type"] = md[1] # XXX overwrite
404
407
  else
405
- $stderr.puts "*** Unimplemented block class: #{cl}"
408
+ $stderr.puts "*** Unimplemented codeblock class: #{cl}"
406
409
  end
407
410
  end
408
411
  end
@@ -411,17 +414,27 @@ COLORS
411
414
  result[0,0] = "\n" unless result[0,1] == "\n"
412
415
  end
413
416
  el.attr.each do |k, v|
414
- if md = k.match(/\Aartwork-(.*)/)
417
+ if md = k.match(/\A(?:artwork|sourcecode)-(.*)/)
415
418
  el.attr.delete(k)
416
419
  artwork_attr[md[1]] = v
417
420
  end
418
421
  end
419
422
  case t
420
423
  when "goat", "ditaa", "mscgen", "plantuml", "plantuml-utxt", "mermaid", "math"
424
+ if gi
425
+ warn "*** Can't set GI #{gi} for composite SVG artset"
426
+ end
421
427
  result, result1 = memoize(:svg_tool_process, t, result)
422
428
  "#{' '*indent}<figure#{el_html_attributes(el)}><artset><artwork #{html_attributes(artwork_attr.merge("type"=> "svg"))}>#{result1.sub(/.*?<svg/m, "<svg")}</artwork><artwork #{html_attributes(artwork_attr.merge("type"=> "ascii-art"))}><![CDATA[#{result}#{result =~ /\n\Z/ ? '' : "\n"}]]></artwork></artset></figure>\n"
423
429
  else
424
- "#{' '*indent}<figure#{el_html_attributes(el)}><artwork#{html_attributes(artwork_attr)}><![CDATA[#{result}#{result =~ /\n\Z/ ? '' : "\n"}]]></artwork></figure>\n"
430
+ gi ||= (
431
+ if !$options.v3 || !t || ARTWORK_TYPES.include?(t)
432
+ "artwork"
433
+ else
434
+ "sourcecode"
435
+ end
436
+ )
437
+ "#{' '*indent}<figure#{el_html_attributes(el)}><#{gi}#{html_attributes(artwork_attr)}><![CDATA[#{result}#{result =~ /\n\Z/ ? '' : "\n"}]]></#{gi}></figure>\n"
425
438
  end
426
439
  end
427
440
  end
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.3.33
4
+ version: 1.3.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-17 00:00:00.000000000 Z
11
+ date: 2021-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown