kramdown-rfc2629 1.3.27 → 1.3.28

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: e75bef07cedf1af17c6bfc0f6c688171af4a5deeb5f473215597617f7c98888f
4
- data.tar.gz: a8d16417fe3a37a092375fba5234857e61b15350eee5f99e9efe25aeeaed8165
3
+ metadata.gz: c6818d86a47ba8a06c199cdbca16a30644b06c4bb517fc7a5a5a35d93161a0e6
4
+ data.tar.gz: cb90602fd0b11b2e010200ffc4fac1727cd0aa446d2e59e5861d4fcd6b1cf579
5
5
  SHA512:
6
- metadata.gz: fc5c770234e58c35c658de4ca7596d0d8ab0d3ea37bb9569e0689086909ba1c45ac0e4a68f39a0839a85abd1b4e55ef18c0b651f36954276be1686aabc501469
7
- data.tar.gz: c3e226f620e093229c30549463dfa42eb99aeeb56bcd55022c0b7265a2531b5c469299f94010fbbe5de585787f08328a8c9991c1dcfebaba5c8552c97a192daa
6
+ metadata.gz: b2c6ca51eaf892fb8b52c4bf115a82830deb1df21afcc0fb28c58eabbe273b727872be851d5e858c1018ce97e3ee5b8e7464086d4652a17af2f1144dda5f86a4
7
+ data.tar.gz: fb3125ce8ee03845999ad6f7e09cc9047ee4f4f3406da987c6a1458c0a4de65d0c2d590f62d02c516aa1d3de4d71e21660d33313fbf370452d57ee98d0a472ee
data/README.md CHANGED
@@ -294,13 +294,24 @@ output generated by the tool (e.g., `plantuml-utxt`).
294
294
 
295
295
  Currently supported labels as of 1.3.9:
296
296
 
297
- * goat, ditaa: ASCII (plaintext) art to figure conversion
298
- * mscgen: Message Sequence Charts
299
- * plantuml: widely used multi-purpose diagram generator
297
+ * [goat][], [ditaa][]: ASCII (plaintext) art to figure conversion
298
+ * [mscgen][]: Message Sequence Charts
299
+ * [plantuml][]: widely used multi-purpose diagram generator
300
300
  * plantuml-utxt: Like plantuml, except that a plantuml-generated
301
301
  plaintext form is used
302
- * mermaid: Very experimental; the conversion to SVG is prone to
302
+ * [mermaid][]: Very experimental; the conversion to SVG is prone to
303
303
  generate black-on-black text in this version
304
+ * math: display math using [tex2svg][] for HTML/PDF and [asciitex][]
305
+ (fork: [asciiTeX][asciiTeX-eggert]) for plaintext
306
+
307
+ [goat]: https://github.com/blampe/goat
308
+ [ditaa]: https://github.com/stathissideris/ditaa
309
+ [mscgen]: http://www.mcternan.me.uk/mscgen/
310
+ [plantuml]: https://plantuml.com
311
+ [mermaid]: https://github.com/mermaid-js/mermaid-cli
312
+ [tex2svg]: https://github.com/mathjax/MathJax-demos-node/blob/master/direct/tex2svg
313
+ [asciitex]: http://asciitex.sourceforge.net/
314
+ [asciiTeX-eggert]: https://github.com/larseggert/asciiTeX
304
315
 
305
316
  Note that this feature does not play well with the CI (continuous
306
317
  integration) support in Martin Thomson's [I-D Template][], as that may
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.3.27'
3
+ s.version = '1.3.28'
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.}
@@ -289,7 +289,12 @@ COLORS
289
289
  REXML::XPath.each(d.root, "//*[@fill]") { |x| x.attributes["fill"] = svg_munch_color(x.attributes["fill"], true) }
290
290
  REXML::XPath.each(d.root, "//*[@id]") { |x| x.attributes["id"] = svg_munch_id(x.attributes["id"]) }
291
291
  ## REXML::XPath.each(d.root, "//rect") { |x| x.attributes["style"] = "fill:none;stroke:black;stroke-width:1" unless x.attributes["style"] }
292
+ # Fix for mermaid:
293
+ REXML::XPath.each(d.root, "//polygon") { |x| x.attributes["rx"] = nil; x.attributes["ry"] = nil }
292
294
  d.to_s
295
+ rescue => detail
296
+ warn "*** Can't clean SVG: #{detail}"
297
+ d
293
298
  end
294
299
 
295
300
  def memoize(meth, *args)
@@ -330,13 +335,13 @@ COLORS
330
335
  when "mermaid"
331
336
  result1, err, _s = Open3.capture3("mmdc -i #{file.path}", stdin_data: result); # -b transparent
332
337
  outpath = file.path + ".svg"
333
- result1 = File.read(outpath)
334
- File.unlink(outpath)
338
+ result1 = File.read(outpath) rescue '' # don't die before providing error message
339
+ File.unlink(outpath) rescue nil # ditto
335
340
  when "plantuml", "plantuml-utxt"
336
341
  plantuml = "@startuml\n#{result}\n@enduml"
337
342
  result1, err, _s = Open3.capture3("plantuml -pipe -tsvg", stdin_data: plantuml);
338
343
  result, err1, _s = Open3.capture3("plantuml -pipe -tutxt", stdin_data: plantuml) if t == "plantuml-utxt"
339
- err << err1
344
+ err << err1.to_s
340
345
  when "math"
341
346
  result1, err, _s = Open3.capture3("tex2svg --font STIX --speech=false #{Shellwords.escape(' ' << result)}");
342
347
  result, err1, _s = Open3.capture3("asciitex -f #{file.path}")
@@ -349,6 +354,10 @@ COLORS
349
354
  result1, err, _s = Open3.capture3("svgcheck -qa", stdin_data: result1);
350
355
  capture_croak("svgcheck", err)
351
356
  # warn ["svgcheck:", result1.inspect]
357
+ if result1 == ''
358
+ warn "*** could not create svg for #{result.inspect[0...20]}..."
359
+ exit 65 # EX_DATAERR
360
+ end
352
361
  [result, result1] # text, svg
353
362
  end
354
363
 
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.27
4
+ version: 1.3.28
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-04 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown