mdless 2.1.39 → 2.1.40

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: 2b666b2fcb580a8298ed456f0a8079e5141e34b7df81e8da1ea390ea4509c4a8
4
- data.tar.gz: 0aafd923d3edf8eca00b221db676a151e9c915c7307e28515ee114a102c9296f
3
+ metadata.gz: b274fea017beeb529c8910e0fd02a25ee621150f20c37e52c922bc1e87787406
4
+ data.tar.gz: cd7abc2945d4513e7155e0431c39dbeffa74fe74698630730396b7746c6094f7
5
5
  SHA512:
6
- metadata.gz: 25c151df130e242e6f02a715e9abad99d5a592969535ce10bf700753d2b89e8ac07b9976c64a1d685141dea918a502278369e096ec3a3521ecabe0e2d557d078
7
- data.tar.gz: e638bf345d55208a539e743f28b2a3b9704c6a7dd3e3f5a9d2064099ca56da739b1a46e79737c44adc70d3d68c5491fd886a1116d9ff6c8cf405a546258a64e1
6
+ metadata.gz: f56b34a3339d10995ca3b62e27fcc49d9fd776e7d15429b4adaea61ca079ac8599c1f149f735cdfad8f9b9862fe2bee6b6d663dd16c7c620db29cd12b7f637bd
7
+ data.tar.gz: 3f4a138e53b0021953521e2a79014f81ba3af12b2bc7ea2f3f69d38689c48d166c5c6e6a99d89116b93e8ddf174eebf8d331a12ec3c9578ebb73a6385aa55714
@@ -611,7 +611,7 @@ module Redcarpet
611
611
 
612
612
  lines = input.split(/\n/)
613
613
  line1 = lines.shift
614
- pre = spaces + (" " * (indent + 1))
614
+ pre = spaces + " "
615
615
 
616
616
  body = lines.map { |l| "#{pre}#{l.rstrip}" }.join("\n")
617
617
  "#{line1}\n#{body}"
@@ -659,12 +659,13 @@ module Redcarpet
659
659
  def nest_lists(input, indent = 0)
660
660
  input.gsub!(%r{<<list(?<id>\d+)-(?<type>.*?)>>(?<content>.*?)<</list\k<id>>>}m) do
661
661
  m = Regexp.last_match
662
- lines = m['content'].split(/\n/)
662
+ lines = m['content'].strip.split(/\n/)
663
+
663
664
  list = nest_lists(lines.map do |l|
664
665
  outdent = l.scan(%r{<</list\d+>>}).count
665
666
  indent += l.scan(/<<list\d+-.*?>>/).count
666
667
  indent -= outdent
667
- "#{' ' * indent}#{l}"
668
+ " #{l}"
668
669
  end.join("\n"), indent)
669
670
  next if list.nil?
670
671
 
@@ -686,7 +687,7 @@ module Redcarpet
686
687
  def fix_items(content, last_indent = 0, levels = [0])
687
688
  content.gsub(%r{^(?<indent> *)<<listitem(?<id>\d+)-(?<type>(?:un)?ordered)>>(?<content>.*?)<</listitem\k<id>>>}m) do
688
689
  m = Regexp.last_match
689
- indent = m['indent'].length
690
+ indent = 0
690
691
  if indent == last_indent
691
692
  levels[indent] ||= 0
692
693
  levels[indent] += 1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CLIMarkdown
4
- VERSION = '2.1.39'
4
+ VERSION = '2.1.40'
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.39
4
+ version: 2.1.40
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-20 00:00:00.000000000 Z
11
+ date: 2023-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redcarpet