mdless 2.1.24 → 2.1.26

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: daa606283636cef493f39150cf92cba89cb92774e1a1d864f08b8e3f30c1d956
4
- data.tar.gz: 22aa99bdb5ecf9eb1e29a79595048098101ccb12b676481cf219bf00fff56ff2
3
+ metadata.gz: a1fb1a921f8fba70376fd696f457190e28222c5c07419dd13aad328323f29622
4
+ data.tar.gz: fb42bcba760484824b3ab6516206645890b8ddbe1274817894fc42780fac42fc
5
5
  SHA512:
6
- metadata.gz: 351d4923b3d652d4ca6900ad691ceea22f33be02127c2ed5c654a4a48ef2b3feb6daa1f086cb98c398bc4f2ed40b7e797d6946d2358c0fb3c721ee5068437176
7
- data.tar.gz: 992a8936d9426acbd56f146606d0b3f42c49900a9e60a70e943a17eef17b450fbe40ee106150135cc755c61407ee05aa2ba2337f400ad38528e0c8a0d0949f03
6
+ metadata.gz: 4325d830a288a4ba59fe4810f350de7c0259ec54a6aade29b440f4d5a71d542cc4b99de1f453d5b6c0f0aba50c5dc833b2311180c1cf8f7865d3c5ca2a6fb419
7
+ data.tar.gz: bbe50fdaa45cf08c2a77b19d3902ed82e72fde33b190b8fc62c98adbec96171b91f7f7d9aad213505ddcf7fa93c03603f4f7e8fcefffe5ee75084e58bce55263
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 2.1.26
2
+
3
+ 2.1.25
4
+ : YAML loading issues caused by safe_load
5
+
1
6
  2.1.24
2
7
  : Save MultiMarkdown metadata into a hash
3
8
  : Allow [%metakey] replacements
@@ -752,7 +752,7 @@ module Redcarpet
752
752
  input.sub!(/(?i-m)^---[ \t]*\n(?<content>(?:[\s\S]*?))\n[-.]{3}[ \t]*\n/m) do
753
753
  m = Regexp.last_match
754
754
  MDLess.log.info('Processing YAML Header')
755
- MDLess.meta = YAML.safe_load(m['content']).map { |k, v| "#{k.downcase}" => v }
755
+ MDLess.meta = YAML.load(m['content']).map { |k, v| "#{k.downcase}" => v }
756
756
  lines = m[0].split(/\n/)
757
757
  longest = lines.longest_element.length
758
758
  longest = longest < MDLess.cols ? longest + 1 : MDLess.cols
@@ -780,10 +780,12 @@ module Redcarpet
780
780
 
781
781
  lines.map do |line|
782
782
  line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
783
- parts = line.match(/[ \t]*(.*?): +(.*?)$/)
784
- key = parts[1].gsub(/[^a-z0-9\-_]/i, '')
785
- value = parts[2].strip
786
- MDLess.meta[key] = value
783
+ parts = line.match(/^[ \t]*(\S.*?):[ \t]+(\S.*?)$/)
784
+ if parts
785
+ key = parts[1].gsub(/[^a-z0-9\-_]/i, '')
786
+ value = parts[2].strip
787
+ MDLess.meta[key] = value
788
+ end
787
789
  line = "#{color('metadata marker')}%#{color('metadata color')}#{line}"
788
790
  line += "\u00A0" * (longest - line.uncolor.strip.length) if (longest - line.uncolor.strip.length).positive?
789
791
  line + xc
@@ -264,6 +264,7 @@ module CLIMarkdown
264
264
  opts.delete(:section)
265
265
  opts.delete(:update_config)
266
266
  opts.delete(:update_theme)
267
+ opts.delete(:width)
267
268
  opts = opts.keys.map(&:to_s).sort.map { |k| [k.to_sym, opts[k.to_sym]] }.to_h
268
269
  f.puts YAML.dump(opts)
269
270
  warn "Config file saved to #{config}"
data/lib/mdless/string.rb CHANGED
@@ -67,7 +67,7 @@ class ::String
67
67
  input.sub!(/(?i-m)^---[ \t]*\n(?<content>[\s\S]*?)\n[-.]{3}[ \t]*\n/m) do
68
68
  m = Regexp.last_match
69
69
  MDLess.log.info('Processing YAML Header')
70
- MDLess.meta = YAML.safe_load(m['content']).map { |k, v| "#{k.downcase}" => v }
70
+ MDLess.meta = YAML.load(m['content']).map { |k, v| "#{k.downcase}" => v }
71
71
  lines = m['content'].split(/\n/)
72
72
  longest = lines.inject { |memo, word| memo.length > word.length ? memo : word }.length
73
73
  longest = longest < @cols ? longest + 1 : @cols
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CLIMarkdown
4
- VERSION = '2.1.24'
4
+ VERSION = '2.1.26'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdless
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.24
4
+ version: 2.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-04 00:00:00.000000000 Z
11
+ date: 2023-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet