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 +4 -4
- data/lib/mdless/console.rb +5 -4
- 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: b274fea017beeb529c8910e0fd02a25ee621150f20c37e52c922bc1e87787406
|
4
|
+
data.tar.gz: cd7abc2945d4513e7155e0431c39dbeffa74fe74698630730396b7746c6094f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f56b34a3339d10995ca3b62e27fcc49d9fd776e7d15429b4adaea61ca079ac8599c1f149f735cdfad8f9b9862fe2bee6b6d663dd16c7c620db29cd12b7f637bd
|
7
|
+
data.tar.gz: 3f4a138e53b0021953521e2a79014f81ba3af12b2bc7ea2f3f69d38689c48d166c5c6e6a99d89116b93e8ddf174eebf8d331a12ec3c9578ebb73a6385aa55714
|
data/lib/mdless/console.rb
CHANGED
@@ -611,7 +611,7 @@ module Redcarpet
|
|
611
611
|
|
612
612
|
lines = input.split(/\n/)
|
613
613
|
line1 = lines.shift
|
614
|
-
pre = spaces +
|
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
|
-
"
|
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 =
|
690
|
+
indent = 0
|
690
691
|
if indent == last_indent
|
691
692
|
levels[indent] ||= 0
|
692
693
|
levels[indent] += 1
|
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.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-
|
11
|
+
date: 2023-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|