mdless 2.1.39 → 2.1.41

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: f1a73a6f53b1069e90cb3c9760f7ec30fa49c7b0bc6583278d85059cadc6558b
4
+ data.tar.gz: 934c7ce94e399d4f91bb3c2a6fb53053e3584ff9efba64d83e2e1c2b30430657
5
5
  SHA512:
6
- metadata.gz: 25c151df130e242e6f02a715e9abad99d5a592969535ce10bf700753d2b89e8ac07b9976c64a1d685141dea918a502278369e096ec3a3521ecabe0e2d557d078
7
- data.tar.gz: e638bf345d55208a539e743f28b2a3b9704c6a7dd3e3f5a9d2064099ca56da739b1a46e79737c44adc70d3d68c5491fd886a1116d9ff6c8cf405a546258a64e1
6
+ metadata.gz: 52641ae7aa9bb96488c43df3793eaafd32c21d36e77695ebe5c9aebb085a2b241ffae9a7d1faa1cef40184b3f49e6da0c795ae36176eafe4c24f0339504a1d42
7
+ data.tar.gz: 44316ff110310cc9f026d6f21782b64f301e7a3cca99d9171fe34dc2ea2725e6731feafeee39d5cbac98ff782ba4e3548ee91810aaa33e5955a8e7fe46e2ee03
@@ -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
@@ -831,7 +832,7 @@ module Redcarpet
831
832
  end
832
833
 
833
834
  def fix_image_attributes(input)
834
- input.gsub(/^( {0,3}\[.*?\]: *\S+) +([^"].*?)$/, '\1')
835
+ input.gsub(/^( {0,3}\[[^^].*?\]: *\S+) +([^"].*?)$/, '\1')
835
836
  end
836
837
 
837
838
  def preprocess(input)
@@ -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.41'
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.41
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