mdless 2.1.25 → 2.1.27
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 +17 -6
- data/lib/mdless/converter.rb +1 -0
- data/lib/mdless/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2ff8e5c411b2dca9194b32e684495ee5a43376da035e427365c7c8c305abc3d
|
4
|
+
data.tar.gz: 7de7a979e5aeeb61cb92d3e0dfd1166aec6ac63f446422592a3a005cd6ec8755
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b458218411a7a4952652aa807c2b98cb2ea298b3f3051b4743acf1afb670c914b690e7ce97e5185cb0a86c83bdf2b3c552d7b2d8075454324ce39fef9629f9c
|
7
|
+
data.tar.gz: d44ebccb7cb2230713c7250e0dcc904961b0f7b9f0fd2f146cbaa24ca7580a748e4282dd23c8e367f6d1bb5176c4c0efa08457cc7bde02481b66c5db722bdde9
|
data/CHANGELOG.md
CHANGED
data/lib/mdless/console.rb
CHANGED
@@ -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
|
755
|
-
|
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
|
@@ -780,10 +789,12 @@ module Redcarpet
|
|
780
789
|
|
781
790
|
lines.map do |line|
|
782
791
|
line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
|
783
|
-
parts = line.match(
|
784
|
-
|
785
|
-
|
786
|
-
|
792
|
+
parts = line.match(/^[ \t]*(\S.*?):[ \t]+(\S.*?)$/)
|
793
|
+
if parts
|
794
|
+
key = parts[1].gsub(/[^a-z0-9\-_]/i, '')
|
795
|
+
value = parts[2].strip
|
796
|
+
MDLess.meta[key] = value
|
797
|
+
end
|
787
798
|
line = "#{color('metadata marker')}%#{color('metadata color')}#{line}"
|
788
799
|
line += "\u00A0" * (longest - line.uncolor.strip.length) if (longest - line.uncolor.strip.length).positive?
|
789
800
|
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/version.rb
CHANGED