mdless 2.1.26 → 2.1.27

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: a1fb1a921f8fba70376fd696f457190e28222c5c07419dd13aad328323f29622
4
- data.tar.gz: fb42bcba760484824b3ab6516206645890b8ddbe1274817894fc42780fac42fc
3
+ metadata.gz: e2ff8e5c411b2dca9194b32e684495ee5a43376da035e427365c7c8c305abc3d
4
+ data.tar.gz: 7de7a979e5aeeb61cb92d3e0dfd1166aec6ac63f446422592a3a005cd6ec8755
5
5
  SHA512:
6
- metadata.gz: 4325d830a288a4ba59fe4810f350de7c0259ec54a6aade29b440f4d5a71d542cc4b99de1f453d5b6c0f0aba50c5dc833b2311180c1cf8f7865d3c5ca2a6fb419
7
- data.tar.gz: bbe50fdaa45cf08c2a77b19d3902ed82e72fde33b190b8fc62c98adbec96171b91f7f7d9aad213505ddcf7fa93c03603f4f7e8fcefffe5ee75084e58bce55263
6
+ metadata.gz: 0b458218411a7a4952652aa807c2b98cb2ea298b3f3051b4743acf1afb670c914b690e7ce97e5185cb0a86c83bdf2b3c552d7b2d8075454324ce39fef9629f9c
7
+ data.tar.gz: d44ebccb7cb2230713c7250e0dcc904961b0f7b9f0fd2f146cbaa24ca7580a748e4282dd23c8e367f6d1bb5176c4c0efa08457cc7bde02481b66c5db722bdde9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  2.1.26
2
2
 
3
+ 2.1.27
4
+ : Error handling when YAML can't be processed
5
+
3
6
  2.1.25
4
7
  : YAML loading issues caused by safe_load
5
8
 
@@ -751,8 +751,17 @@ module Redcarpet
751
751
  in_yaml = true
752
752
  input.sub!(/(?i-m)^---[ \t]*\n(?<content>(?:[\s\S]*?))\n[-.]{3}[ \t]*\n/m) do
753
753
  m = Regexp.last_match
754
- MDLess.log.info('Processing YAML Header')
755
- MDLess.meta = YAML.load(m['content']).map { |k, v| "#{k.downcase}" => v }
754
+ MDLess.log.info('Processing YAML header')
755
+ begin
756
+ MDLess.meta = YAML.load(m['content']).map { |k, v| "#{k.downcase}" => v }
757
+ rescue Psych::DisallowedClass => e
758
+ @log.error('Error reading YAML header')
759
+ @log.error(e)
760
+ MDLess.meta = {}
761
+ rescue StandardError => e
762
+ @log.error("StandardError: #{e}")
763
+ end
764
+
756
765
  lines = m[0].split(/\n/)
757
766
  longest = lines.longest_element.length
758
767
  longest = longest < MDLess.cols ? longest + 1 : MDLess.cols
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CLIMarkdown
4
- VERSION = '2.1.26'
4
+ VERSION = '2.1.27'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdless
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.26
4
+ version: 2.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra