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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/mdless/console.rb +7 -5
- data/lib/mdless/converter.rb +1 -0
- data/lib/mdless/string.rb +1 -1
- data/lib/mdless/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1fb1a921f8fba70376fd696f457190e28222c5c07419dd13aad328323f29622
|
4
|
+
data.tar.gz: fb42bcba760484824b3ab6516206645890b8ddbe1274817894fc42780fac42fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4325d830a288a4ba59fe4810f350de7c0259ec54a6aade29b440f4d5a71d542cc4b99de1f453d5b6c0f0aba50c5dc833b2311180c1cf8f7865d3c5ca2a6fb419
|
7
|
+
data.tar.gz: bbe50fdaa45cf08c2a77b19d3902ed82e72fde33b190b8fc62c98adbec96171b91f7f7d9aad213505ddcf7fa93c03603f4f7e8fcefffe5ee75084e58bce55263
|
data/CHANGELOG.md
CHANGED
data/lib/mdless/console.rb
CHANGED
@@ -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.
|
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(
|
784
|
-
|
785
|
-
|
786
|
-
|
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
|
data/lib/mdless/converter.rb
CHANGED
@@ -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.
|
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
|
data/lib/mdless/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|