mdless 2.1.18 → 2.1.21

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: 9c5dcb4862eb5ba44f64df14e47cf1007cb294861ab914f9df073c0d02563958
4
- data.tar.gz: d8859b260c397faa82cc7d5f4651da968a45dfb5356950f519ab7815b014360b
3
+ metadata.gz: b6fb8357105dbb36f4bdfcc82e7dae805f0f6f10df0725de4f82c52d77692c45
4
+ data.tar.gz: 1451440e33927c06856125e66be4a296eb04da3606369fc8655767db0294fde9
5
5
  SHA512:
6
- metadata.gz: '03378f55e76ae1754ddd392c3fc673fb64b970096784371edf5416c6d914791177f5721e2c5f3c301e2f573bbdda900dcc6564d34debe1e9e48dc725ed784b17'
7
- data.tar.gz: 244b2789b7cc881446369a9b77b609ee5da864508aabd9039008c561048e3a3a440fa1c617b0c809f8cdca9f0ebe9d22516ed8846b46f55eb5929533ff2b6b65
6
+ metadata.gz: 2d35d49aad25b3c43990a94c8f8f884c2d46944db2af487cbda170ce7289ccbf43cb18bf20af8a334009c6aa8ae48a96eea1dd87196d326843be20645089cdcd
7
+ data.tar.gz: d59b26f80ac9fe72d01c94357f9ca65ffc9000f89a0fadc3385209ce8a96897b657f6e69a6aa8c5eb98bfc36dd518332a62610f5576584d28f6770614773c78f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  2.1.17
2
- 2.1.15
2
+ : YAML metadata and negative line lengths
3
3
 
4
4
  2.1.14
5
5
  : Spaces on a line separating metadata won't break display
data/lib/mdless/string.rb CHANGED
@@ -74,11 +74,11 @@ class ::String
74
74
  line = "#{color('metadata marker')}#{'%' * longest}"
75
75
  else
76
76
  line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
77
- line = "#{color('metadata color')}#{line}<br>"
77
+ line = "#{color('metadata marker')}%#{color('metadata color')}#{line}#{xc}"
78
78
  end
79
79
 
80
- line += "\u00A0" * (longest - line.uncolor.strip.length) + xc
81
- line
80
+ line += "\u00A0" * (longest - line.uncolor.strip.length) if (longest - line.uncolor.strip.length).positive?
81
+ line + xc
82
82
  end.join("\n") + "#{xc}\n"
83
83
  end
84
84
  end
@@ -93,8 +93,8 @@ class ::String
93
93
  longest = longest < @cols ? longest + 1 : @cols
94
94
  lines.map do |line|
95
95
  line.sub!(/^(.*?:)[ \t]+(\S)/, '\1 \2')
96
- line = "#{color('metadata color')}#{line}<br>"
97
- line += "\u00A0" * (longest - line.uncolor.strip.length)
96
+ line = "#{color('metadata color')}#{line}"
97
+ line += "\u00A0" * (longest - line.uncolor.strip.length) if (longest - line.uncolor.strip.length).positive?
98
98
  line + xc
99
99
  end.join("\n") + "#{"\u00A0" * longest}#{xc}\n"
100
100
  end
@@ -39,7 +39,7 @@ module CLIMarkdown
39
39
  def remove_meta(input)
40
40
  first_line = input.split("\n").first
41
41
  if first_line =~ /(?i-m)^---[ \t]*?$/
42
- input.sub!(/(?im)^---[ \t]*\n([\s\S]*?)\n[-.]{3}[ \t]*\n/, '')
42
+ input.sub!(/(?im)^---[ \t]*\n([\s\S\n]*?)\n[-.]{3}[ \t]*\n/, '')
43
43
  elsif first_line =~ /(?i-m)^[\w ]+:\s+\S+/
44
44
  input.sub!(/(?im)^([\S ]+:[\s\S]*?)+(?=\n\n)/, '')
45
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CLIMarkdown
4
- VERSION = '2.1.18'
4
+ VERSION = '2.1.21'
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.18
4
+ version: 2.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra